pub struct Record<'a> { /* private fields */ }Expand description
A record: positional or keyed. Copyable, zero-copy accessors.
Implementations§
Source§impl<'a> Record<'a>
impl<'a> Record<'a>
Sourcepub fn keyed(&self) -> bool
pub fn keyed(&self) -> bool
Whether the record is keyed (its first live or dead unit is an SOH).
Sourcepub fn field(&self, n: usize) -> &'a [u8] ⓘ
pub fn field(&self, n: usize) -> &'a [u8] ⓘ
Raw slice of unit n (layout at its edges included); empty when
there is no such unit.
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Number of positional units (0 for a keyed record).
Sourcepub fn value(&self, n: usize) -> Result<Cow<'a, [u8]>>
pub fn value(&self, n: usize) -> Result<Cow<'a, [u8]>>
Logical value of unit n: text decoded, layout trimmed.
Sourcepub fn list(&self, n: usize) -> Result<Vec<Cow<'a, [u8]>>>
pub fn list(&self, n: usize) -> Result<Vec<Cow<'a, [u8]>>>
Unit n as a flat list: a level holding exactly one positional
record (an empty level is the empty list).
Sourcepub fn get(&self, key: &str) -> Result<Option<Cow<'a, [u8]>>>
pub fn get(&self, key: &str) -> Result<Option<Cow<'a, [u8]>>>
Logical value for a key (last wins), or None.
Sourcepub fn get_level(&self, key: &str) -> Result<Option<Body<'a>>>
pub fn get_level(&self, key: &str) -> Result<Option<Body<'a>>>
The value for a key as a nested level, or None.
pub fn has_key(&self, key: &str) -> bool
Trait Implementations§
impl<'a> Copy for Record<'a>
impl<'a> Eq for Record<'a>
impl<'a> StructuralPartialEq for Record<'a>
Auto Trait Implementations§
impl<'a> Forget for Record<'a>
impl<'a> Freeze for Record<'a>
impl<'a> RefUnwindSafe for Record<'a>
impl<'a> Send for Record<'a>
impl<'a> Sync for Record<'a>
impl<'a> Unpin for Record<'a>
impl<'a> UnsafeUnpin for Record<'a>
impl<'a> UnwindSafe for Record<'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