Enum webb_proposals::TypedChainId
source · #[non_exhaustive]pub enum TypedChainId {
None,
Evm(u32),
Substrate(u32),
PolkadotParachain(u32),
KusamaParachain(u32),
RococoParachain(u32),
Cosmos(u32),
Solana(u32),
Ink(u32),
}
Expand description
Proposal Target Chain and its type (6 bytes).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
None chain type.
This is used when the chain type is not known.
Evm(u32)
EVM Based Chain (Mainnet, Polygon, …etc)
Substrate(u32)
Standalone Substrate Based Chain (Webb, Edgeware, …etc)
PolkadotParachain(u32)
Polkadot Parachains.
KusamaParachain(u32)
Kusama Parachains.
RococoParachain(u32)
Rococo Parachains.
Cosmos(u32)
Cosmos / CosmWasm Chains.
Solana(u32)
Solana Program.
Ink(u32)
Ink Based Chains
Implementations§
source§impl TypedChainId
impl TypedChainId
sourcepub const LENGTH: usize = 6usize
pub const LENGTH: usize = 6usize
Length of the TypedChainId
in bytes.
sourcepub fn chain_id(&self) -> u64
pub fn chain_id(&self) -> u64
Get the chain id as a u64
. This represents
the typed chain ID that should be used to differentiate
between differently typed chains with the same underlying
chain id.
sourcepub const fn underlying_chain_id(&self) -> u32
pub const fn underlying_chain_id(&self) -> u32
Get the chain id as a u32
. This represents
the un-typed underlying chain ID for the chain.
sourcepub fn into_bytes(self) -> [u8; 6]
pub fn into_bytes(self) -> [u8; 6]
Get the underlying bytes of ChainType
.
Trait Implementations§
source§impl Clone for TypedChainId
impl Clone for TypedChainId
source§fn clone(&self) -> TypedChainId
fn clone(&self) -> TypedChainId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TypedChainId
impl Debug for TypedChainId
source§impl Decode for TypedChainId
impl Decode for TypedChainId
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
Attempt to deserialise the value from input.
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
source§impl Default for TypedChainId
impl Default for TypedChainId
source§fn default() -> TypedChainId
fn default() -> TypedChainId
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for TypedChainId
impl<'de> Deserialize<'de> for TypedChainId
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encode for TypedChainId
impl Encode for TypedChainId
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
Convert self to a slice and append it to the destination.
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl From<TypedChainId> for [u8; 6]
impl From<TypedChainId> for [u8; 6]
source§fn from(v: TypedChainId) -> Self
fn from(v: TypedChainId) -> Self
Converts to this type from the input type.
source§impl From<u64> for TypedChainId
impl From<u64> for TypedChainId
source§impl Hash for TypedChainId
impl Hash for TypedChainId
source§impl MaxEncodedLen for TypedChainId
impl MaxEncodedLen for TypedChainId
source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
source§impl Ord for TypedChainId
impl Ord for TypedChainId
source§fn cmp(&self, other: &TypedChainId) -> Ordering
fn cmp(&self, other: &TypedChainId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for TypedChainId
impl PartialEq for TypedChainId
source§fn eq(&self, other: &TypedChainId) -> bool
fn eq(&self, other: &TypedChainId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TypedChainId
impl PartialOrd for TypedChainId
source§fn partial_cmp(&self, other: &TypedChainId) -> Option<Ordering>
fn partial_cmp(&self, other: &TypedChainId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for TypedChainId
impl Serialize for TypedChainId
source§impl TypeInfo for TypedChainId
impl TypeInfo for TypedChainId
impl Copy for TypedChainId
impl EncodeLike for TypedChainId
impl Eq for TypedChainId
impl StructuralEq for TypedChainId
impl StructuralPartialEq for TypedChainId
Auto Trait Implementations§
impl RefUnwindSafe for TypedChainId
impl Send for TypedChainId
impl Sync for TypedChainId
impl Unpin for TypedChainId
impl UnwindSafe for TypedChainId
Blanket Implementations§
source§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
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§impl<T> Clear for T
impl<T> Clear for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<T> DefensiveMax<T> for Twhere
T: PartialOrd,
impl<T> DefensiveMax<T> for Twhere
T: PartialOrd,
source§fn defensive_max(self, other: T) -> T
fn defensive_max(self, other: T) -> T
source§fn defensive_strict_max(self, other: T) -> T
fn defensive_strict_max(self, other: T) -> T
source§impl<T> DefensiveMin<T> for Twhere
T: PartialOrd,
impl<T> DefensiveMin<T> for Twhere
T: PartialOrd,
source§fn defensive_min(self, other: T) -> T
fn defensive_min(self, other: T) -> T
source§fn defensive_strict_min(self, other: T) -> T
fn defensive_strict_min(self, other: T) -> T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.