struct Candiru::TypedField(T)
- Candiru::TypedField(T)
- Struct
- Value
- Object
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.crConstructors
Instance Method Summary
-
#ffi_type : FFI::Type
Returns the FFI type corresponding to this typed field.
-
#matches?(value : T)
Returns whether this typed field matches the given value.
-
#matches?(value : StructInstance)
Returns whether this typed field matches the given value.
-
#matches?(value)
Returns whether this typed field matches the given value.
-
#offset : UInt64
Returns the offset of this typed field in the parent struct.
-
#scaffolding? : StructScaffolding | Nil
In case this typed field is a pointer to another struct, or a struct itself, returns the scaffolding of that struct.
- #to_s(io)
-
#type
Returns the Crystal type (T) corresponding to this typed field.
Constructor Detail
def self.new(ffi_type : Crystal::FFI::Type, offset : UInt64, scaffolding : Nil | Candiru::StructScaffolding = nil)
#
Instance Method Detail
In case this typed field is a pointer to another struct, or a struct itself, returns the scaffolding of that struct.