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>
impl<'a> Frame<'a>
Sourcepub const fn received_bytes(&self) -> &'a [u8] ⓘ
pub const fn received_bytes(&self) -> &'a [u8] ⓘ
Exact complete received item, with its original headers and ordering.
Sourcepub const fn header(&self) -> &Header<'a>
pub const fn header(&self) -> &Header<'a>
Inspect the original header without reconstructing it.
Sourcepub fn validate(
&self,
profile: Profile,
limits: Limits,
) -> Result<Item<'a>, CborError>
pub fn validate( &self, profile: Profile, limits: Limits, ) -> Result<Item<'a>, CborError>
Validate this receipt using a fresh, caller-selected resource budget.
Sourcepub fn integer(&self) -> Result<Integer, CborError>
pub fn integer(&self) -> Result<Integer, CborError>
Extract an integer without truncating either argument domain.
Sourcepub fn simple_value(&self) -> Result<u8, CborError>
pub fn simple_value(&self) -> Result<u8, CborError>
Extract an untagged simple value (20/21 are booleans, 22 is null).
Sourcepub fn as_bool(&self) -> Result<bool, CborError>
pub fn as_bool(&self) -> Result<bool, CborError>
Extract an untagged boolean; other simple values have a different type.
Sourcepub fn as_bytes(&self) -> Result<&'a [u8], CborError>
pub fn as_bytes(&self) -> Result<&'a [u8], CborError>
Borrow definite byte-string contents; chunked strings have no single span.
Sourcepub fn as_text(&self) -> Result<&'a str, CborError>
pub fn as_text(&self) -> Result<&'a str, CborError>
Borrow definite text, checking UTF-8 even on a framing-only receipt.
Sourcepub fn string_chunks(&self) -> Result<StringChunks<'a>, CborError>
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.
Sourcepub fn children(&self) -> Result<Cursor<'a>, CborError>
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.
Sourcepub fn tagged_bytes(&self) -> Result<TaggedBytes<'a>, CborError>
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.