Skip to main content

Frame

Struct Frame 

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

Receipt for one well-formed item, without a basic-validity claim.

Framing allows invalid UTF-8 and equivalent map keys. Use validate_exact or Frame::validate when the basic generic data model is required. Tag semantics are always separate. All payload spans borrow the original owner.

Implementations§

Source§

impl<'a> Frame<'a>

Source

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

Exact complete received item, with its original headers and ordering.

Source

pub const fn header(&self) -> &Header<'a>

Inspect the original header without reconstructing it.

Source

pub fn validate( &self, profile: Profile, limits: Limits, ) -> Result<Item<'a>, CborError>

Validate this receipt using a fresh, caller-selected resource budget.

Source

pub fn integer(&self) -> Result<Integer, CborError>

Extract an integer without truncating either argument domain.

Source

pub fn float(&self) -> Result<Float, CborError>

Extract protected floating-point bits.

Source

pub fn simple_value(&self) -> Result<u8, CborError>

Extract an untagged simple value (20/21 are booleans, 22 is null).

Source

pub fn as_bool(&self) -> Result<bool, CborError>

Extract an untagged boolean; other simple values have a different type.

Source

pub fn as_bytes(&self) -> Result<&'a [u8], CborError>

Borrow definite byte-string contents; chunked strings have no single span.

Source

pub fn as_text(&self) -> Result<&'a str, CborError>

Borrow definite text, checking UTF-8 even on a framing-only receipt.

Source

pub fn string_chunks(&self) -> Result<StringChunks<'a>, CborError>

Iterate borrowed contents of string chunks. Definite strings yield once. Framing-only text chunks still require UTF-8 validation by the consumer.

Source

pub fn children(&self) -> Result<Cursor<'a>, CborError>

Traverse direct array children, alternating map keys/values, or a tag’s single child. This framing cursor has its own cumulative limits; it does not inherit or strengthen a parent’s validity claim.

Source

pub fn tagged_bytes(&self) -> Result<TaggedBytes<'a>, CborError>

Borrow an arbitrary tag’s exact outer wrapper and contiguous byte payload. No claim is made about embedded CBOR or registered tag semantics.

Auto Trait Implementations§

§

impl<'a> Forget for Frame<'a>

§

impl<'a> Freeze for Frame<'a>

§

impl<'a> Move for Frame<'a>

§

impl<'a> RefUnwindSafe for Frame<'a>

§

impl<'a> Send for Frame<'a>

§

impl<'a> Sync for Frame<'a>

§

impl<'a> Unpin for Frame<'a>

§

impl<'a> UnsafeUnpin for Frame<'a>

§

impl<'a> UnwindSafe for Frame<'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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.