struct LMDB::Value
- LMDB::Value
- Struct
- Value
- Object
Defined in:
lmdb/types.crConstructors
-
.new(size : UInt64, data : Pointer(UInt8))
Initialize
self
from a given size and a bytes pointer. -
.new(ptr : Pointer(T)) forall T
Initialize a
LMDB::Value
from a given pointer. -
.new(slice : Slice(T) | Array(T) | StaticArray(T, _)) forall T
Initialize a
LMDB::Value
from a given slice or array. -
.new(str : String)
Initialize a
LMDB::Value
from a given string. -
.new(value : T) forall T
Initialize a
LMDB::Value
from a given value.
Macro Summary
Instance Method Summary
- #==(other : self)
- #as_array(of klass : T.class) : Array(T) forall T
- #as_bool : Bool
- #as_char : Char
- #as_f : Float64
- #as_f32
- #as_f64 : Float64
- #as_i : Int32
- #as_i128 : Int128
- #as_i16 : Int16
- #as_i32 : Int32
- #as_i64 : Int64
- #as_i8 : Int8
- #as_slice(of klass : T.class) : Slice(T) forall T
- #as_str : String
- #as_u128 : UInt128
- #as_u16 : UInt16
- #as_u32 : UInt32
- #as_u64 : UInt64
- #as_u8 : UInt8
- #as_value(of klass : Array(T).class) forall T
- #as_value(of klass : Slice(T).class) forall T
- #as_value(of klass : String.class)
- #as_value(of klass : T.class) : T forall T
- #clone
-
#cmp_data(other : self, txn : Transaction, db : Database)
Compare two
Value
s according to a particular transaction and database. -
#cmp_key(other : self, txn : Transaction, db : Database)
Compare two
Value
s according to a particular transaction and database. - #data : Pointer(UInt8)
- #size : UInt64
- #to_slice : Bytes
- #to_unsafe
Constructor Detail
Initialize self
from a given size and a bytes pointer.
Initialize a LMDB::Value
from a given pointer. No extra memory
allocated.
Initialize a LMDB::Value
from a given slice or array. No extra memory
allocated.
Initialize a LMDB::Value
from a given string. No extra memory
allocated.
Initialize a LMDB::Value
from a given value. Copies value contents to
a new allocated pointer.
Macro Detail
Instance Method Detail
Compare two Value
s according to a particular transaction and database.
Assume both items are data items in the database. The given database db
must be configured with the sorted duplicates option.
Returns 0
if the two objects are equal, a negative number if this object
is considered less than other, or a positive number otherwise.
Compare two Value
s according to a particular transaction and database.
Assume both items are keys in the database.
Returns 0
if the two objects are equal, a negative number if this object
is considered less than other, or a positive number otherwise.