Skip to main content

Heading

Struct Heading 

Source
pub struct Heading<'a> { /* private fields */ }
Expand description

The heading of a document: keyed units after SYN, in written order. Lookups take the last value for a duplicate key.

Implementations§

Source§

impl<'a> Heading<'a>

Source

pub fn empty() -> Self

The heading of a document without SYN.

Source

pub fn raw(&self) -> &'a [u8] ⓘ

The heading’s bytes (after SYN, before the body).

Source

pub fn pairs(&self) -> &[(&'a [u8], Cow<'a, [u8]>)]

(key, value) pairs in written order. A nested-level value is its raw DLE … CAN bytes; see Heading::blob.

Source

pub fn get(&self, key: &str) -> Option<&[u8]>

The value for a key (last wins), or None.

Source

pub fn keys(&self) -> Vec<&'a [u8]>

Keys in written order.

Source

pub fn shape(&self) -> Option<&str>

The shape key, when present and UTF-8.

Source

pub fn version(&self) -> u32

The version key as an integer; 1 when absent.

Source

pub fn raw_blob(&self) -> Option<&'a [u8]>

Raw unit of the blob key (a level), or None.

Source

pub fn blob(&self) -> Result<Option<Body<'a>>>

The blob table, when declared as a nested level.

Source

pub fn is_empty(&self) -> bool

Auto Trait Implementations§

§

impl<'a> Forget for Heading<'a>

§

impl<'a> Freeze for Heading<'a>

§

impl<'a> RefUnwindSafe for Heading<'a>

§

impl<'a> Send for Heading<'a>

§

impl<'a> Sync for Heading<'a>

§

impl<'a> Unpin for Heading<'a>

§

impl<'a> UnsafeUnpin for Heading<'a>

§

impl<'a> UnwindSafe for Heading<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.