struct Novika::FFI::UnionType

Overview

Type-side representation of a union.

Defined in:

novika/ffi.cr

Instance Method Summary

Instance methods inherited from struct Novika::FFI::StructType

alignment(*args, **options)
alignment(*args, **options, &)
alignment
, from?(form : StructViewForm) from?, make! : StructView make!, padded_size(*args, **options)
padded_size(*args, **options, &)
padded_size
, references?(*args, **options)
references?(*args, **options, &)
references?
, to_s(io) to_s, view_for(handle : Pointer(Void)) : StructView view_for

Constructor methods inherited from struct Novika::FFI::StructType

new(layout : StructLayout) new

Instance methods inherited from module Novika::FFI::ForeignType

alloc : Pointer(Void) alloc, from(form : Form) : ForeignValue from, from?(form : Form) : ForeignValue | Nil from?, matches?(value : ForeignValue) : Bool matches?, sizeof : UInt64 sizeof, to_ffi_type : Crystal::FFI::Type to_ffi_type, unbox(box : Pointer(Void)) : ForeignValue unbox

Instance Method Detail

def alloc : Pointer(Void) #
Description copied from module Novika::FFI::ForeignType

Allocates memory for this type. Returns a pointer to that memory.


def matches?(view : UnionView) : Bool #

def sizeof : UInt64 #
Description copied from module Novika::FFI::ForeignType

Returns the size of this type, in bytes.


def to_ffi_type : Crystal::FFI::Type #
Description copied from module Novika::FFI::ForeignType

Returns the corresponding LibFFI type.


def to_s(io) #

def unbox(box : Pointer(Void)) : ForeignValue #
Description copied from module Novika::FFI::ForeignType

Retrieves ForeignValue of this type from the given void pointer box.


def view_for(handle : Pointer(Void)) : StructView #
Description copied from struct Novika::FFI::StructType

Returns the struct view corresponding to this struct type, wrapped around the given handle.