Skip to main content

DecoderRef

Struct DecoderRef 

Source
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: u16

The ABI major version the decoder was built against.

§abi_minor: u16

The ABI minor version the decoder was built against.

§location: DecoderLocation

Where the module is.

§digest: Digest

The 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: CapabilitySet

What 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 str

A human readable name, for error messages.

Implementations§

Source§

impl<'a> DecoderRef<'a>

Source

pub const VERSION: u16 = 1

The record version this build writes.

Source

pub fn encode(&self, w: &mut Writer<'_>) -> AbiResult<()>

Writes this record’s payload.

§Errors

Returns whatever the writer returns.

Source

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>

Source§

fn clone(&self) -> DecoderRef<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for DecoderRef<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for DecoderRef<'a>

Source§

impl<'a> PartialEq for DecoderRef<'a>

Source§

fn eq(&self, other: &DecoderRef<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for DecoderRef<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for DecoderRef<'a>

§

impl<'a> RefUnwindSafe for DecoderRef<'a>

§

impl<'a> Send for DecoderRef<'a>

§

impl<'a> Sync for DecoderRef<'a>

§

impl<'a> Unpin for DecoderRef<'a>

§

impl<'a> UnsafeUnpin for DecoderRef<'a>

§

impl<'a> UnwindSafe for DecoderRef<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.