pub struct Document { /* private fields */ }Implementations§
Source§impl Document
impl Document
pub fn new<T>(data: &T, enc: FlEncoderSession) -> Result<Self, Error>where
T: Serialize,
pub fn new_with_id<S, T>( doc_id: S, data: &T, enc: FlEncoderSession, ) -> Result<Self, Error>
pub fn new_with_id_fleece<S: Into<String>>( doc_id: S, fleece_data: FLSliceResult, ) -> Self
Sourcepub fn decode_body<T: DeserializeOwned>(self) -> Result<T, Error>
pub fn decode_body<T: DeserializeOwned>(self) -> Result<T, Error>
Decode body of document
Sourcepub fn update_body<T>(
&mut self,
data: &T,
enc: FlEncoderSession,
) -> Result<(), Error>where
T: Serialize,
pub fn update_body<T>(
&mut self,
data: &T,
enc: FlEncoderSession,
) -> Result<(), Error>where
T: Serialize,
Update internal buffer with data, you need save document to database to make this change permanent
Sourcepub fn sequence(&self) -> Option<u64>
pub fn sequence(&self) -> Option<u64>
Returns a document’s current sequence in the local database. This number increases every time the document is saved, and a more recently saved document will have a greater sequence number than one saved earlier, so sequences may be used as an abstract ‘clock’ to tell relative modification times
Sourcepub fn revision_id(&self) -> Option<&str>
pub fn revision_id(&self) -> Option<&str>
Returns a document’s revision ID, which is a short opaque string that’s guaranteed to be unique to every change made to the document.
pub fn flags(&self) -> Option<DocumentFlags>
pub fn generation(&self) -> c_uint
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl !Send for Document
impl !Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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
Mutably borrows from an owned value. Read more