module Novika::FFI::ForeignValue

Overview

Base type for Novika FFI values (both heap & stack allocated).

Direct including types

Defined in:

novika/ffi.cr

Instance Method Summary

Instance Method Detail

abstract def box : Pointer(Void) #

Wraps this value in a void pointer.


def must_be_of(type : ForeignType) #

Raises if this value is not of the given ForeignType type.


abstract def to_form? : Form | Nil #

Determines the best form type to represent this foreign value, then builds and returns a form of that type.

Returns nil if value is nothing.


abstract def write_to!(base : Pointer(Void)) : Pointer(Void) #

Writes this value starting at the given base pointer. Returns the base pointer.