pub trait BinaryXml: Xml {
// Required methods
fn with_octets<R, C, W: Work>(
&self,
snapshot: Snapshot<Self::Document, Self::Generation>,
node: Self::Id,
execution: &W,
visitor: impl for<'source> FnOnce(&'source [u8]) -> Result<R, C>,
) -> Result<Result<R, C>, Self::Error>;
fn with_binary<R, C>(
&self,
snapshot: Snapshot<Self::Document, Self::Generation>,
node: Self::Id,
operation: &Reader<'_>,
visitor: impl for<'source> FnOnce(Decoded<'source>) -> Result<R, C>,
) -> Result<Result<R, C>, Self::Error>;
}Expand description
XML-owned lexical decoding of an encapsulated binary value.
Common processing selects the original Encoding attribute/default; the
owner validates the XML lexical form,
including children and whitespace, before invoking the visitor. It admits
traversal, decoded capacity and copies before doing that work. Existing XML
base64 processing must be reused rather than reparsing serialized XML.
The owner supplies the actual decoded buffer and its producing Parser inside
the scope. Common processing constructs the Reader with the selected encoding
through Parser::read_query_in. Both original and current operation
ceilings are therefore preserved by construction, rather than trusting an
adapter to return a Reader with the correct budget. ASN.1 depth is not XML depth.
Decoded offsets identify this binary source, never physical XML bytes. The original XML node and generation accompany every returned common error.
Required Methods§
Sourcefn with_octets<R, C, W: Work>(
&self,
snapshot: Snapshot<Self::Document, Self::Generation>,
node: Self::Id,
execution: &W,
visitor: impl for<'source> FnOnce(&'source [u8]) -> Result<R, C>,
) -> Result<Result<R, C>, Self::Error>
fn with_octets<R, C, W: Work>( &self, snapshot: Snapshot<Self::Document, Self::Generation>, node: Self::Id, execution: &W, visitor: impl for<'source> FnOnce(&'source [u8]) -> Result<R, C>, ) -> Result<Result<R, C>, Self::Error>
Visits decoded octets that are not themselves an ASN.1 value, such as a
CertDigest DigestValue. No ASN.1 depth gate applies to these octets.
Both entry points reuse one owner lexical/decoding kernel and admit its
complete work/capacity before scanning or decoding. No implicit I/O.
Sourcefn with_binary<R, C>(
&self,
snapshot: Snapshot<Self::Document, Self::Generation>,
node: Self::Id,
operation: &Reader<'_>,
visitor: impl for<'source> FnOnce(Decoded<'source>) -> Result<R, C>,
) -> Result<Result<R, C>, Self::Error>
fn with_binary<R, C>( &self, snapshot: Snapshot<Self::Document, Self::Generation>, node: Self::Id, operation: &Reader<'_>, visitor: impl for<'source> FnOnce(Decoded<'source>) -> Result<R, C>, ) -> Result<Result<R, C>, Self::Error>
Visits the actual decoded source under the current operation.
The result cannot borrow the temporary buffer or parser. Independent retained results must retain their allocation charges after scope exit. The owner must not swallow a visitor refusal or call the visitor twice.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".