Skip to main content

OwnedDecoded

Struct OwnedDecoded 

Source
pub struct OwnedDecoded {
    pub parser: Parser,
    pub bytes: OwnedVec<u8>,
    pub base: u64,
    pub depth: u32,
}
Expand description

Independently owned decoded bytes and their actual producing session.

This has no internal borrowed pointers. Move sources into their final accounted catalogue before borrowing parsed certificates or status values. A later borrow cannot outlive the source or coexist with moving it. Storage remains charged to the bytes’ original account; a new query pays current work.

ⓘ
use structured_asn1::{Encoding, Reader};
use structured_xades::binary::OwnedDecoded;
fn escape<'a>(source: OwnedDecoded, operation: &Reader<'a>) -> Reader<'a> {
    source.reader_in(operation, Encoding::Der).unwrap()
}

Fields§

§parser: Parser

Actual producing session, including work already consumed on this source.

§bytes: OwnedVec<u8>

Original decoded allocation, transferred without re-encoding or copying.

§base: u64

Offset of this window in the decoded document, never a physical XML offset.

§depth: u32

Actual source-reader ASN.1 depth, independent of XML depth; fresh roots use zero.

Implementations§

Source§

impl OwnedDecoded

Source

pub fn view(&self) -> Decoded<'_>

Borrows the source without allocation, account cloning or a new Parser.

Source

pub fn reader_in<'source>( &'source self, operation: &Reader<'source>, encoding: Encoding, ) -> Result<Reader<'source>>

Opens the original window under both source and current-operation limits. The material schema selects its encoding; this never infers a permissive codec from malformed bytes. Existing source work is not reset or credited.

Trait Implementations§

Source§

impl Debug for OwnedDecoded

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.