struct Novika::Hole

Overview

Holes are similar to Crystal's uninitialized or out, in that they allow you to allocate memory for a type, pass a pointer to that memory to e.g. a C function, and let that C function write into the memory. The written value can then be retrieved by opening the hole.

Included Modules

Defined in:

novika/forms/foreign.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Novika::Schedulable::ShouldOpenWhenScheduled

schedule!(engine : Engine, stack : Block) schedule!

Instance methods inherited from module Novika::Form

a(type : T.class) : T forall T a, desc(io : IO)
desc : String
desc
, die(details : String) die, effect(io)
effect
effect
, on_open(engine : Engine) : self on_open, on_parent_open(engine : Engine) : self on_parent_open, onto(block : Block) : self onto, sel(a, b) sel, to_quote : Quote to_quote

Instance methods inherited from module Novika::Schedulable

schedule(engine : Engine, stack : Block) schedule, schedule!(engine : Engine, stack : Block) schedule!

Constructor Detail

def self.new(type : FFI::ForeignType) #

[View source]
def self.new(pointer : FFI::UntypedPointer) #

[View source]

Class Method Detail

def self.typedesc #

[View source]

Instance Method Detail

def address(*args, **options) #

Returns the address of this hole's content in memory.


[View source]
def address(*args, **options, &) #

Returns the address of this hole's content in memory.


[View source]
def desc(io) #

[View source]
def handle : Pointer(Void) #

Returns a pointer to this hole's content.


[View source]
def on_open(engine : Engine) : self #
Description copied from module Novika::Form

Reacts to this form being opened with engine.


[View source]
def to_s(io) #

[View source]