struct Candiru::TypedField(T)

Overview

A struct field holding a Crystal type T.

T must implement .to_ffi which must return the FFI::Type corresponding to T.

Included Modules

Defined in:

candiru.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ffi_type : Crystal::FFI::Type, offset : UInt64, scaffolding : Nil | Candiru::StructScaffolding = nil) #

[View source]

Instance Method Detail

def ffi_type : FFI::Type #

Returns the FFI type corresponding to this typed field.


[View source]
def matches?(value : T) #

Returns whether this typed field matches the given value.


[View source]
def matches?(value : StructInstance) #

Returns whether this typed field matches the given value.


[View source]
def matches?(value) #

Returns whether this typed field matches the given value.


[View source]
def offset : UInt64 #

Returns the offset of this typed field in the parent struct.


[View source]
def scaffolding? : StructScaffolding | Nil #

In case this typed field is a pointer to another struct, or a struct itself, returns the scaffolding of that struct.


[View source]
def to_s(io) #

[View source]
def type #

Returns the Crystal type (T) corresponding to this typed field.


[View source]