pub struct DocumentBody<'a> { /* private fields */ }Expand description
A document record’s value, borrowed.
Decoding copies nothing. See the module note for what it checks.
Implementations§
Source§impl<'a> DocumentBody<'a>
impl<'a> DocumentBody<'a>
Sourcepub fn decode(value: &'a [u8]) -> Result<DocumentBody<'a>>
pub fn decode(value: &'a [u8]) -> Result<DocumentBody<'a>>
Reads a document record’s value.
§Errors
Code::Corrupt if the value is shorter than a header, if the tag is
one this version does not define, or if it is a scalar whose payload is
not the length the header claims.
Sourcepub fn head(self) -> u32
pub fn head(self) -> u32
The header word, for a reader that wants a flag this version has no name for.
Sourcepub fn count(self) -> usize
pub fn count(self) -> usize
How many elements a container holds, or how many bytes of payload a scalar has.
Sourcepub fn is_array(self) -> bool
pub fn is_array(self) -> bool
Whether this is an array. False for an object and for every scalar.
Sourcepub fn is_interned(self) -> bool
pub fn is_interned(self) -> bool
Whether this is an object whose keys are ids from the collection’s key table.
Trait Implementations§
Source§impl<'a> Clone for DocumentBody<'a>
impl<'a> Clone for DocumentBody<'a>
Source§fn clone(&self) -> DocumentBody<'a>
fn clone(&self) -> DocumentBody<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for DocumentBody<'a>
Auto Trait Implementations§
impl<'a> Freeze for DocumentBody<'a>
impl<'a> RefUnwindSafe for DocumentBody<'a>
impl<'a> Send for DocumentBody<'a>
impl<'a> Sync for DocumentBody<'a>
impl<'a> Unpin for DocumentBody<'a>
impl<'a> UnsafeUnpin for DocumentBody<'a>
impl<'a> UnwindSafe for DocumentBody<'a>
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