Skip to main content

InputBuffer

Struct InputBuffer 

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

One validated read-only buffer borrowed for a synchronous operation.

Implementations§

Source§

impl<'a> InputBuffer<'a>

Source

pub fn new( specification: &'a BufferSpec, bytes: &'a [u8], ) -> Result<Self, CoreError>

Binds exact metadata to readable bytes.

Content hashing and seal verification remain the caller’s responsibility; this constructor verifies the exact accessible length.

§Errors

Returns an error when metadata is invalid or the length differs.

Source

pub const fn specification(&self) -> &BufferSpec

Returns exact validated metadata.

Source

pub const fn bytes(&self) -> &[u8] ⓘ

Returns the readable bytes.

Trait Implementations§

Source§

impl<'a> Debug for InputBuffer<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for InputBuffer<'a>

§

impl<'a> RefUnwindSafe for InputBuffer<'a>

§

impl<'a> Send for InputBuffer<'a>

§

impl<'a> Sync for InputBuffer<'a>

§

impl<'a> Unpin for InputBuffer<'a>

§

impl<'a> UnsafeUnpin for InputBuffer<'a>

§

impl<'a> UnwindSafe for InputBuffer<'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.