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: ParserActual producing session, including work already consumed on this source.
bytes: OwnedVec<u8>Original decoded allocation, transferred without re-encoding or copying.
base: u64Offset of this window in the decoded document, never a physical XML offset.
depth: u32Actual source-reader ASN.1 depth, independent of XML depth; fresh roots use zero.
Implementations§
Source§impl OwnedDecoded
impl OwnedDecoded
Sourcepub fn view(&self) -> Decoded<'_>
pub fn view(&self) -> Decoded<'_>
Borrows the source without allocation, account cloning or a new Parser.
Sourcepub fn reader_in<'source>(
&'source self,
operation: &Reader<'source>,
encoding: Encoding,
) -> Result<Reader<'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.