referrerpolicy=no-referrer-when-downgrade
parachain_template_runtime::opaque

Type Alias Block

Source
pub type Block = Block<Header, UncheckedExtrinsic>;
Expand description

Opaque block type.

Aliased Type§

struct Block {
    pub header: Header<u32, BlakeTwo256>,
    pub extrinsics: Vec<OpaqueExtrinsic>,
}

Fields§

§header: Header<u32, BlakeTwo256>

The block header.

§extrinsics: Vec<OpaqueExtrinsic>

The accompanying extrinsics.

Trait Implementations

Source§

impl<Header, Extrinsic> Block for Block<Header, Extrinsic>
where Extrinsic: MaybeSerialize + Member + Codec + DecodeWithMemTracking + ExtrinsicLike, Header: Header + MaybeSerializeDeserialize,

Source§

type Extrinsic = Extrinsic

Type for extrinsics.
Source§

type Header = Header

Header type.
Source§

type Hash = <<Block<Header, Extrinsic> as Block>::Header as Header>::Hash

Block hash type.
Source§

fn header(&self) -> &<Block<Header, Extrinsic> as Block>::Header

Returns a reference to the header.
Source§

fn extrinsics(&self) -> &[<Block<Header, Extrinsic> as Block>::Extrinsic]

Returns a reference to the list of extrinsics.
Source§

fn deconstruct( self, ) -> (<Block<Header, Extrinsic> as Block>::Header, Vec<<Block<Header, Extrinsic> as Block>::Extrinsic>)

Split the block into header and list of extrinsics.
Source§

fn new( header: <Block<Header, Extrinsic> as Block>::Header, extrinsics: Vec<<Block<Header, Extrinsic> as Block>::Extrinsic>, ) -> Block<Header, Extrinsic>

Creates new block from header and extrinsics.
Source§

fn encode_from( header: &<Block<Header, Extrinsic> as Block>::Header, extrinsics: &[<Block<Header, Extrinsic> as Block>::Extrinsic], ) -> Vec<u8>

Creates an encoded block from the given header and extrinsics without requiring the creation of an instance.
Source§

fn hash(&self) -> Self::Hash

Returns the hash of the block.
Source§

impl<Header, Extrinsic> Clone for Block<Header, Extrinsic>
where Header: Clone, Extrinsic: Clone,

Source§

fn clone(&self) -> Block<Header, Extrinsic>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Header, Extrinsic> Debug for Block<Header, Extrinsic>
where Header: Debug, Extrinsic: Debug,

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<Header, Extrinsic> Decode for Block<Header, Extrinsic>
where Header: Decode, Vec<Extrinsic>: Decode,

Source§

fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Block<Header, Extrinsic>, Error>
where __CodecInputEdqy: Input,

Attempt to deserialise the value from 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,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl<'de, Header, Extrinsic> Deserialize<'de> for Block<Header, Extrinsic>
where Header: Deserialize<'de>, Extrinsic: Deserialize<'de>,

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Block<Header, Extrinsic>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Header, Extrinsic> Encode for Block<Header, Extrinsic>
where Header: Encode, Vec<Extrinsic>: Encode,

Source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
Source§

fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
where __CodecOutputEdqy: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl<Header, Extrinsic> PartialEq for Block<Header, Extrinsic>
where Header: PartialEq, Extrinsic: PartialEq,

Source§

fn eq(&self, other: &Block<Header, Extrinsic>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Header, Extrinsic> Serialize for Block<Header, Extrinsic>
where Header: Serialize, Extrinsic: Serialize,

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<Header, Extrinsic> TypeInfo for Block<Header, Extrinsic>
where Header: TypeInfo + 'static, Vec<Extrinsic>: TypeInfo + 'static, Extrinsic: TypeInfo + 'static,

Source§

type Identity = Block<Header, Extrinsic>

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

impl<Header, Extrinsic> DecodeWithMemTracking for Block<Header, Extrinsic>
where Header: DecodeWithMemTracking, Vec<Extrinsic>: DecodeWithMemTracking,

Source§

impl<Header, Extrinsic> EncodeLike for Block<Header, Extrinsic>
where Header: Encode, Vec<Extrinsic>: Encode,

Source§

impl<Header, Extrinsic> Eq for Block<Header, Extrinsic>
where Header: Eq, Extrinsic: Eq,

Source§

impl<Header, Extrinsic> StructuralPartialEq for Block<Header, Extrinsic>