Struct couchbase_lite::Document
source · [−]pub struct Document { /* private fields */ }Implementations
sourceimpl 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> where
S: Into<String>,
T: Serialize,
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 RefUnwindSafe for Document
impl !Send for Document
impl !Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more