pub struct List<'a> { /* private fields */ }Expand description
Container that stores its elements sequentially and provides get by position access
Implementations§
Source§impl<'a> List<'a>
impl<'a> List<'a>
Sourcepub fn add_value<'c, 'p: 'c, 'd>(
&'p mut self,
value: impl AsValue<'d>,
) -> Result<Value<'c>, Error>
pub fn add_value<'c, 'p: 'c, 'd>( &'p mut self, value: impl AsValue<'d>, ) -> Result<Value<'c>, Error>
Adds new value to this list
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Returns slice of bytes representing current document.
It’s guaranteed to be subslice of initial buffer and for root document it will starting at 0.
So by taking it’s len you can get how many bytes in buffer are used
Sourcepub fn empty() -> List<'static>
pub fn empty() -> List<'static>
Returns new empty list
List is read only so no new elements can be added to it
Trait Implementations§
impl<'a> Eq for List<'a>
impl<'a> StructuralPartialEq for List<'a>
Auto Trait Implementations§
impl<'a> Freeze for List<'a>
impl<'a> RefUnwindSafe for List<'a>
impl<'a> !Send for List<'a>
impl<'a> !Sync for List<'a>
impl<'a> Unpin for List<'a>
impl<'a> UnwindSafe for List<'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