struct Novika::FFI::StructFieldDesc

Overview

Holds the description of a struct field: its id (purely for convenience), type (one of ForeignTypes), and, most importantly, offset.

Defined in:

novika/ffi.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(id : String, type : ForeignType, offset : UInt64) #

[View source]

Instance Method Detail

def clone #

[View source]
def copy_with(id _id = @id, type _type = @type, offset _offset = @offset) #

[View source]
def fetch!(base : Pointer(Void)) : ForeignValue #

offset, assuming base points to the start of the struct this field is a member of.

The latter is not enforced; therefore, this method is considered unsafe.


[View source]
def id : String #

def offset : UInt64 #

def put!(base : Pointer(Void), value : ForeignValue) #

Writes value at base plus this field's offset, assuming base points to the start of the struct this field is a member of.

The latter is not enforced; therefore, this method is considered unsafe.


[View source]
def to_s(io) #

[View source]
def type : ForeignType #