Struct ledb::RawDocument

source ·
pub struct RawDocument(_, _);
Expand description

Raw document with id representation

Implementations§

Create document using raw data

Add id to document

Remove id from document

Checks when document has primary key/identifier

Get the primary key/identifier of document

Require the primary key/identifier of document

Unwrap document value

Convert document to binary representation

At this moment we use CBOR for effectively store documents into DB backend. Since the internal representation does not contains primary identifier, it adds on reading documents from DB.

Restore document from binary representation

At this moment we use CBOR for effectively store documents into DB backend. Since the internal representation does not contains primary identifier, it adds on reading documents from DB.

Convert typed document to raw representation

Typically the application deals with typed documents which represented by specific structures. The database backend processes generic document representation which is CBOR Value.

Restore typed document from raw representation

Typically the application deals with typed documents which represented by specific structures. The database backend processes generic document representation which is CBOR Value.

Methods from Deref<Target = Value>§

Returns true if the value is an object.

If the value is an object, returns the associated BTreeMap. Returns None otherwise.

If the value is an object, returns the associated mutable BTreeMap. Returns None otherwise.

Returns true if the value is an array.

If the value is an array, returns the associated Vec. Returns None otherwise.

If the value is an array, returns the associated mutable Vec. Returns None otherwise.

Returns true if the value is a byte string.

Returns the associated byte string or None if the value has a different type.

Returns the associated mutable byte string or None if the value has a different type.

Returns true if the value is a string.

Returns the associated string or None if the value has a different type.

Returns the associated mutable string or None if the value has a different type.

Retrns true if the value is a number.

Returns true if the Value is a i64. Returns false otherwise.

Returns true if the Value is a u64. Returns false otherwise.

Returns true if the Value is a f64. Returns false otherwise.

If the Value is a number, return or cast it to a i64. Returns None otherwise.

If the Value is a number, return or cast it to a u64. Returns None otherwise.

If the Value is a number, return or cast it to a f64. Returns None otherwise.

Returns true if the value is a boolean.

If the value is a Boolean, returns the associated bool. Returns None otherwise.

Returns true if the value is a Null. Returns false otherwise.

If the value is a Null, returns (). Returns None otherwise.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Clone this value, and then immediately put it into a Box behind a trait object of this trait. Read more
Returns the address of self. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Clone this value, and then immediately put it into a Box behind a trait object of this trait. Read more
Returns the address of self. Read more
Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.