Struct sbor::FixedEnumVariant

source ·
pub struct FixedEnumVariant<const DISCRIMINATOR: u8, T> {
    pub fields: T,
}

Fields§

§fields: T

Implementations§

source§

impl<const DISCRIMINATOR: u8, T> FixedEnumVariant<DISCRIMINATOR, T>

source

pub fn new(fields: T) -> Self

source

pub fn for_encoding(fields: &T) -> FixedEnumVariant<DISCRIMINATOR, &T>

Trait Implementations§

source§

impl<X: CustomValueKind, const DISCRIMINATOR: u8, T: SborTuple<X>> Categorize<X> for FixedEnumVariant<DISCRIMINATOR, T>

source§

impl<X: CustomValueKind, D: Decoder<X>, const DISCRIMINATOR: u8, T: Decode<X, D> + SborTuple<X>> Decode<X, D> for FixedEnumVariant<DISCRIMINATOR, T>

source§

fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<X> ) -> Result<Self, DecodeError>

Decodes the type from the decoder, which should match a preloaded value kind. Read more
source§

impl<X: CustomValueKind, E: Encoder<X>, const DISCRIMINATOR: u8, T: Encode<X, E> + SborTuple<X>> Encode<X, E> for FixedEnumVariant<DISCRIMINATOR, T>

source§

fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>

Encodes the SBOR value’s kind to the encoder
source§

fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>

Encodes the SBOR body of the type to the encoder. Read more
source§

impl<X: CustomValueKind, const DISCRIMINATOR: u8, T> IsFixedEnumVariant<X, T> for FixedEnumVariant<DISCRIMINATOR, T>
where T: for<'a> Encode<X, VecEncoder<'a, X>> + SborTuple<X>,

source§

const DISCRIMINATOR: u8 = DISCRIMINATOR

§

type EncodingFixedEnumVariant<'a> = FixedEnumVariant<DISCRIMINATOR, &'a T> where T: 'a

source§

fn new(fields: T) -> Self

source§

fn for_encoding<'a>(fields: &'a T) -> Self::EncodingFixedEnumVariant<'a>

source§

fn into_fields(self) -> T

source§

impl<X: CustomValueKind, const DISCRIMINATOR: u8, T: SborTuple<X>> SborEnum<X> for FixedEnumVariant<DISCRIMINATOR, T>

Auto Trait Implementations§

§

impl<const DISCRIMINATOR: u8, T> RefUnwindSafe for FixedEnumVariant<DISCRIMINATOR, T>
where T: RefUnwindSafe,

§

impl<const DISCRIMINATOR: u8, T> Send for FixedEnumVariant<DISCRIMINATOR, T>
where T: Send,

§

impl<const DISCRIMINATOR: u8, T> Sync for FixedEnumVariant<DISCRIMINATOR, T>
where T: Sync,

§

impl<const DISCRIMINATOR: u8, T> Unpin for FixedEnumVariant<DISCRIMINATOR, T>
where T: Unpin,

§

impl<const DISCRIMINATOR: u8, T> UnwindSafe for FixedEnumVariant<DISCRIMINATOR, T>
where T: UnwindSafe,

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>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.
source§

impl<T> BasicCategorize for T

source§

impl<T> BasicDecode for T

source§

impl<T> BasicEncode for T

source§

impl<T> BasicSborEnum for T