pub struct DecoderRef<'a> {
pub abi_major: u16,
pub abi_minor: u16,
pub location: DecoderLocation,
pub digest: Digest,
pub required: CapabilitySet,
pub name: &'a str,
}Expand description
Which decoder reads this dataset.
Fields§
§abi_major: u16The ABI major version the decoder was built against.
abi_minor: u16The ABI minor version the decoder was built against.
location: DecoderLocationWhere the module is.
digest: DigestThe digest of the module.
This is the identity of the decoder. A host that already trusts a native implementation of this exact module substitutes it here and skips the sandbox, and a host that does not runs the bytes it hashed.
required: CapabilitySetWhat the decoder needs the host to be able to do.
Carrying this in the container as well as in the handshake means a host can refuse a dataset before it has loaded a single instruction of it, which is a much better error than one that arrives halfway through a query.
name: &'a strA human readable name, for error messages.
Implementations§
Source§impl<'a> DecoderRef<'a>
impl<'a> DecoderRef<'a>
Sourcepub fn decode(p: &mut Reader<'a>) -> AbiResult<Self>
pub fn decode(p: &mut Reader<'a>) -> AbiResult<Self>
Reads this record’s payload.
An unknown location kind decodes as DecoderLocation::External, because the one thing a
reader must not do with a decoder it cannot place is run something else.
§Errors
Returns iris_abi::Error if the payload is truncated or the name is not UTF-8.
Trait Implementations§
Source§impl<'a> Clone for DecoderRef<'a>
impl<'a> Clone for DecoderRef<'a>
Source§fn clone(&self) -> DecoderRef<'a>
fn clone(&self) -> DecoderRef<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more