Skip to main content

Head

Struct Head 

Source
pub struct Head<O, P = Maybe> { /* private fields */ }
Expand description

A validated head over immutable wire storage.

Implementations§

Source§

impl<O: Source, P: Proof> Head<O, P>

Source

pub fn bind(owner: O, layout: Layout) -> Result<Self, BindError>

Source

pub fn borrow(&self) -> Head<&[u8], P>

Source§

impl<O, P> Head<O, P>

Source

pub const fn form(&self) -> Form

Source

pub fn into_owner(self) -> O

Source

pub const fn owner(&self) -> &O

Source§

impl<P: Proof> Head<Bytes, P>

Source

pub fn from_path( owner: Bytes, target: Range<usize>, path_len: usize, peer: Option<Range<usize>>, ) -> Result<Self, BindError>

Source

pub fn retain(self) -> Head<Shared, P>

Source§

impl<O: Scope, P> Head<O, P>

Source

pub fn scope<T>( self, use_head: impl for<'id> FnOnce(Head<O::Scoped<'id>, P>) -> T, ) -> T

Source§

impl<P> Head<Bytes<Owner<'_, Span<Plain<Layout>, Owned, Frozen>>>, P>

Source

pub fn into_inner(self) -> Head<Bytes, P>

Source§

impl<O: Source, P: Proof> Head<O, P>

Source

pub fn try_bound(bound: Bound<O>) -> Result<Self, BindError>

Source§

impl<'a, P> Head<&'a [u8], P>

Source

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

Source§

impl<'a, P: Proof> Head<&'a [u8], P>

Source

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

Trait Implementations§

Source§

impl<O: Source, P> AsRef<[u8]> for Head<O, P>

Source§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.

Auto Trait Implementations§

§

impl<O, P> Forget for Head<O, P>

§

impl<O, P> Freeze for Head<O, P>
where O: Freeze, P: Freeze,

§

impl<O, P> RefUnwindSafe for Head<O, P>

§

impl<O, P> Send for Head<O, P>
where O: Send, P: Send,

§

impl<O, P> Sync for Head<O, P>
where O: Sync, P: Sync,

§

impl<O, P> Unpin for Head<O, P>
where O: Unpin, P: Unpin,

§

impl<O, P> UnsafeUnpin for Head<O, P>
where O: UnsafeUnpin, P: UnsafeUnpin,

§

impl<O, P> UnwindSafe for Head<O, P>
where O: UnwindSafe, P: UnwindSafe,

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> Convert<T> for T

Source§

fn into(self) -> T

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.