pub struct SubnetworkId(/* private fields */);Expand description
The domain representation of a Subnetwork ID
Implementations§
Source§impl SubnetworkId
impl SubnetworkId
pub const fn from_byte(b: u8) -> SubnetworkId
pub const fn from_bytes(bytes: [u8; 20]) -> SubnetworkId
Sourcepub fn is_builtin(&self) -> bool
pub fn is_builtin(&self) -> bool
Returns true if the subnetwork is a built-in subnetwork, which means all nodes, including partial nodes, must validate it, and its transactions always use 0 gas.
Sourcepub fn is_builtin_or_native(&self) -> bool
pub fn is_builtin_or_native(&self) -> bool
Returns true if the subnetwork is the native or a built-in subnetwork
Trait Implementations§
Source§impl AsRef<[u8]> for SubnetworkId
impl AsRef<[u8]> for SubnetworkId
Source§impl BorshDeserialize for SubnetworkId
impl BorshDeserialize for SubnetworkId
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for SubnetworkId
impl BorshSerialize for SubnetworkId
Source§impl Clone for SubnetworkId
impl Clone for SubnetworkId
Source§fn clone(&self) -> SubnetworkId
fn clone(&self) -> SubnetworkId
Returns a duplicate 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 SubnetworkId
impl Debug for SubnetworkId
Source§impl Default for SubnetworkId
impl Default for SubnetworkId
Source§fn default() -> SubnetworkId
fn default() -> SubnetworkId
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SubnetworkId
impl<'de> Deserialize<'de> for SubnetworkId
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 Display for SubnetworkId
impl Display for SubnetworkId
Source§impl FromHex for SubnetworkId
impl FromHex for SubnetworkId
Source§impl FromStr for SubnetworkId
impl FromStr for SubnetworkId
Source§impl Hash for SubnetworkId
impl Hash for SubnetworkId
Source§impl Ord for SubnetworkId
impl Ord for SubnetworkId
Source§fn cmp(&self, other: &SubnetworkId) -> Ordering
fn cmp(&self, other: &SubnetworkId) -> 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 SubnetworkId
impl PartialEq for SubnetworkId
Source§impl PartialOrd for SubnetworkId
impl PartialOrd for SubnetworkId
Source§impl Serialize for SubnetworkId
impl Serialize for SubnetworkId
Source§impl TryFrom<&[u8]> for SubnetworkId
impl TryFrom<&[u8]> for SubnetworkId
impl Eq for SubnetworkId
impl StructuralPartialEq for SubnetworkId
Auto Trait Implementations§
impl Freeze for SubnetworkId
impl RefUnwindSafe for SubnetworkId
impl Send for SubnetworkId
impl Sync for SubnetworkId
impl Unpin for SubnetworkId
impl UnwindSafe for SubnetworkId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T> Deserialize<'de, 20> for T
impl<'de, T> Deserialize<'de, 20> for T
Source§fn deserialize<D>(deserializer: D) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialization function for types T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)
Source§impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
fn saturating_into(self) -> U
Source§impl<const N: usize, T> Serialize<N> for T
impl<const N: usize, T> Serialize<N> for T
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize
self using the provided Serializer.