[−][src]Struct ledb::RawDocument
Raw document with id representation
Implementations
impl RawDocument
[src]
pub fn new(doc: Value) -> Self
[src]
Create document using raw data
pub fn with_id(self, id: Primary) -> Self
[src]
Add id to document
pub fn without_id(self) -> Self
[src]
Remove id from document
pub fn has_id(&self) -> bool
[src]
Checks when document has primary key/identifier
pub fn get_id(&self) -> &Option<Primary>
[src]
Get the primary key/identifier of document
pub fn req_id(&self) -> Result<Primary>
[src]
Require the primary key/identifier of document
pub fn into_inner(self) -> Value
[src]
Unwrap document value
pub fn to_bin(&self) -> Result<Vec<u8>>
[src]
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.
pub fn from_bin(raw: &[u8]) -> Result<Self>
[src]
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.
pub fn from_doc<T>(doc: &T) -> Result<Self> where
T: Serialize + Document + Sized,
[src]
T: Serialize + Document + Sized,
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.
pub fn into_doc<T>(self) -> Result<T> where
T: DeserializeOwned + Document,
[src]
T: DeserializeOwned + Document,
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.
Trait Implementations
impl Clone for RawDocument
[src]
fn clone(&self) -> RawDocument
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for RawDocument
[src]
impl Deref for RawDocument
[src]
impl DerefMut for RawDocument
[src]
impl PartialEq<RawDocument> for RawDocument
[src]
fn eq(&self, other: &RawDocument) -> bool
[src]
fn ne(&self, other: &RawDocument) -> bool
[src]
impl StructuralPartialEq for RawDocument
[src]
Auto Trait Implementations
impl RefUnwindSafe for RawDocument
impl Send for RawDocument
impl Sync for RawDocument
impl Unpin for RawDocument
impl UnwindSafe for RawDocument
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Clone + Send + Sync,
[src]
T: 'a + Clone + Send + Sync,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
[src]
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> SafeBorrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,