pub struct RawDocument(/* private fields */);
Expand description
Raw document with id representation
Implementations§
Source§impl RawDocument
impl RawDocument
Sourcepub fn without_id(self) -> Self
pub fn without_id(self) -> Self
Remove id from document
Sourcepub fn into_inner(self) -> Value
pub fn into_inner(self) -> Value
Unwrap document value
Sourcepub fn to_bin(&self) -> Result<Vec<u8>>
pub fn to_bin(&self) -> Result<Vec<u8>>
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.
Sourcepub fn from_bin(raw: &[u8]) -> Result<Self>
pub fn from_bin(raw: &[u8]) -> Result<Self>
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.
Sourcepub fn from_doc<T>(doc: &T) -> Result<Self>
pub fn from_doc<T>(doc: &T) -> Result<Self>
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.
Sourcepub fn into_doc<T>(self) -> Result<T>where
T: DeserializeOwned + Document,
pub fn into_doc<T>(self) -> Result<T>where
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§
Source§impl Clone for RawDocument
impl Clone for RawDocument
Source§fn clone(&self) -> RawDocument
fn clone(&self) -> RawDocument
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RawDocument
impl Debug for RawDocument
Source§impl Deref for RawDocument
impl Deref for RawDocument
Source§impl DerefMut for RawDocument
impl DerefMut for RawDocument
Source§impl PartialEq for RawDocument
impl PartialEq for RawDocument
impl StructuralPartialEq for RawDocument
Auto Trait Implementations§
impl Freeze for RawDocument
impl RefUnwindSafe for RawDocument
impl Send for RawDocument
impl Sync for RawDocument
impl Unpin for RawDocument
impl UnwindSafe for RawDocument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> DefaultFeatures<'a> for T
impl<'a, T> DefaultFeatures<'a> for T
Source§fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>
Box
behind a trait object of this trait.Source§impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
Source§fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>
Box
behind a trait object of this trait.