#[repr(C)]pub struct BlockWeight(/* private fields */);
Expand description
BlockWeight type for fork choice rule.
The smaller the solution range is, the heavier is the block.
Implementations§
Source§impl BlockWeight
impl BlockWeight
Trait Implementations§
Source§impl Add for BlockWeight
impl Add for BlockWeight
Source§type Output = BlockWeight
type Output = BlockWeight
The resulting type after applying the
+
operator.Source§fn add(self, rhs: BlockWeight) -> BlockWeight
fn add(self, rhs: BlockWeight) -> BlockWeight
Performs the
+
operation. Read moreSource§impl AddAssign for BlockWeight
impl AddAssign for BlockWeight
Source§fn add_assign(&mut self, rhs: BlockWeight)
fn add_assign(&mut self, rhs: BlockWeight)
Performs the
+=
operation. Read moreSource§impl Clone for BlockWeight
impl Clone for BlockWeight
Source§fn clone(&self) -> BlockWeight
fn clone(&self) -> BlockWeight
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 BlockWeight
impl Debug for BlockWeight
Source§impl Decode for BlockWeight
impl Decode for BlockWeight
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.
§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
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
Source§impl Default for BlockWeight
impl Default for BlockWeight
Source§fn default() -> BlockWeight
fn default() -> BlockWeight
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BlockWeight
impl<'de> Deserialize<'de> for BlockWeight
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 BlockWeight
impl Display for BlockWeight
Source§impl Encode for BlockWeight
impl Encode for BlockWeight
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<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl From<BlockWeight> for u128
impl From<BlockWeight> for u128
Source§fn from(value: BlockWeight) -> Self
fn from(value: BlockWeight) -> Self
Converts to this type from the input type.
Source§impl From<u128> for BlockWeight
impl From<u128> for BlockWeight
Source§impl Hash for BlockWeight
impl Hash for BlockWeight
Source§impl MaxEncodedLen for BlockWeight
impl MaxEncodedLen for BlockWeight
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 BlockWeight
impl Ord for BlockWeight
Source§fn cmp(&self, other: &BlockWeight) -> Ordering
fn cmp(&self, other: &BlockWeight) -> 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 BlockWeight
impl PartialEq for BlockWeight
Source§impl PartialOrd for BlockWeight
impl PartialOrd for BlockWeight
Source§impl Serialize for BlockWeight
impl Serialize for BlockWeight
Source§impl Sub for BlockWeight
impl Sub for BlockWeight
Source§type Output = BlockWeight
type Output = BlockWeight
The resulting type after applying the
-
operator.Source§fn sub(self, rhs: BlockWeight) -> BlockWeight
fn sub(self, rhs: BlockWeight) -> BlockWeight
Performs the
-
operation. Read moreSource§impl SubAssign for BlockWeight
impl SubAssign for BlockWeight
Source§fn sub_assign(&mut self, rhs: BlockWeight)
fn sub_assign(&mut self, rhs: BlockWeight)
Performs the
-=
operation. Read moreSource§impl TypeInfo for BlockWeight
impl TypeInfo for BlockWeight
impl Copy for BlockWeight
impl EncodeLike for BlockWeight
impl Eq for BlockWeight
impl StructuralPartialEq for BlockWeight
Auto Trait Implementations§
impl Freeze for BlockWeight
impl RefUnwindSafe for BlockWeight
impl Send for BlockWeight
impl Sync for BlockWeight
impl Unpin for BlockWeight
impl UnwindSafe for BlockWeight
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,
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Decode
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
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 more