struct Novika::FFI::UnionView
- Novika::FFI::UnionView
- Novika::FFI::StructView
- Struct
- Value
- Object
Overview
Value-side representation of a union.
Defined in:
novika/ffi.crInstance Method Summary
-
#box : Pointer(Void)
Wraps this value in a void pointer.
-
#size
Returns the number of elements in this container.
- #to_s(io)
-
#unsafe_fetch(index : Int)
Returns the element at the given index, without doing any bounds check.
-
#unsafe_put(index : Int, value : ForeignValue)
Sets the element at the given index to value, without doing any bounds check.
-
#write_to!(base : Pointer(Void)) : Pointer(Void)
Writes this value starting at the given base pointer.
Instance methods inherited from struct Novika::FFI::StructView
==(other : StructView)
==,
[](id : String)
[],
[]=(id : String, value : ForeignValue)
[]=,
[]?(id : String)
[]?,
address(*args, **options)address(*args, **options, &) address, has_field?(*args, **options)
has_field?(*args, **options, &) has_field?, hash(hasher) hash, layout : StructLayout layout, size size, to_form? : Form | Nil to_form?, to_s(io) to_s, unsafe_fetch(index : Int) unsafe_fetch, unsafe_put(index : Int, value : ForeignValue) unsafe_put
Constructor methods inherited from struct Novika::FFI::StructView
new(layout : Novika::FFI::StructLayout, handle : Pointer(Void))
new
Instance methods inherited from module Novika::FFI::ForeignValue
box : Pointer(Void)
box,
must_be_of(type : ForeignType)
must_be_of,
to_form? : Form | Nil
to_form?,
write_to!(base : Pointer(Void)) : Pointer(Void)
write_to!
Instance Method Detail
Wraps this value in a void pointer.
Returns the number of elements in this container.
Returns the element at the given index, without doing any bounds check.
Indexable
makes sure to invoke this method with index in 0...size
,
so converting negative indices to positive ones is not needed here.
Clients never invoke this method directly. Instead, they access
elements with #[](index)
and #[]?(index)
.
This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.
Sets the element at the given index to value, without doing any bounds check.
Indexable::Mutable
makes sure to invoke this method with index in
0...size
, so converting negative indices to positive ones is not needed
here.
Clients never invoke this method directly. Instead, they modify elements
with #[]=(index, value)
.
This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.
Writes this value starting at the given base pointer. Returns the base pointer.