Struct scrypto::prelude::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>
impl<const DISCRIMINATOR: u8, T> FixedEnumVariant<DISCRIMINATOR, T>
pub fn new(fields: T) -> FixedEnumVariant<DISCRIMINATOR, T>
pub fn for_encoding(fields: &T) -> FixedEnumVariant<DISCRIMINATOR, &T>
Trait Implementations§
source§impl<X, const DISCRIMINATOR: u8, T> Categorize<X> for FixedEnumVariant<DISCRIMINATOR, T>where
X: CustomValueKind,
T: SborTuple<X>,
impl<X, const DISCRIMINATOR: u8, T> Categorize<X> for FixedEnumVariant<DISCRIMINATOR, T>where
X: CustomValueKind,
T: SborTuple<X>,
fn value_kind() -> ValueKind<X>
source§impl<X, D, const DISCRIMINATOR: u8, T> Decode<X, D> for FixedEnumVariant<DISCRIMINATOR, T>
impl<X, D, const DISCRIMINATOR: u8, T> Decode<X, D> for FixedEnumVariant<DISCRIMINATOR, T>
source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<X>
) -> Result<FixedEnumVariant<DISCRIMINATOR, T>, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<X> ) -> Result<FixedEnumVariant<DISCRIMINATOR, T>, DecodeError>
Decodes the type from the decoder, which should match a preloaded value kind. Read more
source§impl<X, E, const DISCRIMINATOR: u8, T> Encode<X, E> for FixedEnumVariant<DISCRIMINATOR, T>
impl<X, E, const DISCRIMINATOR: u8, T> Encode<X, E> for FixedEnumVariant<DISCRIMINATOR, T>
source§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
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>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
Encodes the SBOR body of the type to the encoder. Read more
source§impl<X, const DISCRIMINATOR: u8, T> IsFixedEnumVariant<X, T> for FixedEnumVariant<DISCRIMINATOR, T>
impl<X, const DISCRIMINATOR: u8, T> IsFixedEnumVariant<X, T> for FixedEnumVariant<DISCRIMINATOR, T>
const DISCRIMINATOR: u8 = DISCRIMINATOR
type EncodingFixedEnumVariant<'a> = FixedEnumVariant<DISCRIMINATOR, &'a T> where T: 'a
fn new(fields: T) -> FixedEnumVariant<DISCRIMINATOR, T>
fn for_encoding<'a>( fields: &'a T ) -> <FixedEnumVariant<DISCRIMINATOR, T> as IsFixedEnumVariant<X, T>>::EncodingFixedEnumVariant<'a>
fn into_fields(self) -> T
source§impl<X, const DISCRIMINATOR: u8, T> SborEnum<X> for FixedEnumVariant<DISCRIMINATOR, T>where
X: CustomValueKind,
T: SborTuple<X>,
impl<X, const DISCRIMINATOR: u8, T> SborEnum<X> for FixedEnumVariant<DISCRIMINATOR, T>where
X: CustomValueKind,
T: SborTuple<X>,
fn get_length(&self) -> usize
fn get_discriminator(&self) -> u8
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§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more