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.


[View source]
def matches?(view : UnionView) : Bool #

[View source]
def sizeof : UInt64 #
Description copied from module Novika::FFI::ForeignType

Returns the size of this type, in bytes.


[View source]
def to_ffi_type : Crystal::FFI::Type #
Description copied from module Novika::FFI::ForeignType

Returns the corresponding LibFFI type.


[View source]
def to_s(io) #

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

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


[View source]
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.


[View source]