struct LMDB::Value

Defined in:

lmdb/types.cr

Constructors

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(size : UInt64, data : Pointer(UInt8)) #

Initialize self from a given size and a bytes pointer.


[View source]
def self.new(ptr : Pointer(T)) forall T #

Initialize a LMDB::Value from a given pointer. No extra memory allocated.


[View source]
def self.new(slice : Slice(T) | Array(T) | StaticArray(T, _)) forall T #

Initialize a LMDB::Value from a given slice or array. No extra memory allocated.


[View source]
def self.new(str : String) #

Initialize a LMDB::Value from a given string. No extra memory allocated.


[View source]
def self.new(value : T) forall T #

Initialize a LMDB::Value from a given value. Copies value contents to a new allocated pointer.


[View source]

Macro Detail

macro check_type!(type) #

[View source]

Instance Method Detail

def ==(other : self) #

[View source]
def as_array(of klass : T.class) : Array(T) forall T #

[View source]
def as_bool : Bool #

[View source]
def as_char : Char #

[View source]
def as_f : Float64 #

[View source]
def as_f32 #

[View source]
def as_f64 : Float64 #

[View source]
def as_i : Int32 #

[View source]
def as_i128 : Int128 #

[View source]
def as_i16 : Int16 #

[View source]
def as_i32 : Int32 #

[View source]
def as_i64 : Int64 #

[View source]
def as_i8 : Int8 #

[View source]
def as_slice(of klass : T.class) : Slice(T) forall T #

[View source]
def as_str : String #

[View source]
def as_u128 : UInt128 #

[View source]
def as_u16 : UInt16 #

[View source]
def as_u32 : UInt32 #

[View source]
def as_u64 : UInt64 #

[View source]
def as_u8 : UInt8 #

[View source]
def as_value(of klass : Array(T).class) forall T #

[View source]
def as_value(of klass : Slice(T).class) forall T #

[View source]
def as_value(of klass : String.class) #

[View source]
def as_value(of klass : T.class) : T forall T #

[View source]
def clone #

Returns a new self with a #cloned #data.


[View source]
def cmp_data(other : self, txn : Transaction, db : Database) #

Compare two Values 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.


[View source]
def cmp_key(other : self, txn : Transaction, db : Database) #

Compare two Values 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.


[View source]
def data : Pointer(UInt8) #

[View source]
def size : UInt64 #

[View source]
def to_slice : Bytes #

[View source]
def to_unsafe #

[View source]