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) #

Instance Method Detail

def clone #

def copy_with(id _id = @id, type _type = @type, offset _offset = @offset) #

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.


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.


def to_s(io) #

def type : ForeignType #