Skip to main content

Payload

Trait Payload 

Source
pub trait Payload {
    // Required method
    fn encode_call_data_to(
        &self,
        metadata: &Metadata,
        out: &mut Vec<u8>,
    ) -> Result<(), Error>;

    // Provided methods
    fn encode_call_data(&self, metadata: &Metadata) -> Result<Vec<u8>, Error> { ... }
    fn validation_details(&self) -> Option<ValidationDetails<'_>> { ... }
}
Expand description

This represents a transaction payload that can be submitted to a node.

Required Methods§

Source

fn encode_call_data_to( &self, metadata: &Metadata, out: &mut Vec<u8>, ) -> Result<(), Error>

Encode call data to the provided output.

Provided Methods§

Source

fn encode_call_data(&self, metadata: &Metadata) -> Result<Vec<u8>, Error>

Encode call data and return the output. This is a convenience wrapper around Payload::encode_call_data_to.

Source

fn validation_details(&self) -> Option<ValidationDetails<'_>>

Returns the details needed to validate the call, which include a statically generated hash, the pallet name, and the call name.

Implementations on Foreign Types§

Source§

impl<T> Payload for Box<T>
where T: Payload + ?Sized,

Source§

fn encode_call_data_to( &self, metadata: &Metadata, out: &mut Vec<u8>, ) -> Result<(), Error>

Source§

fn encode_call_data(&self, metadata: &Metadata) -> Result<Vec<u8>, Error>

Source§

fn validation_details(&self) -> Option<ValidationDetails<'_>>

Source§

impl<T> Payload for Rc<T>
where T: Payload + ?Sized,

Source§

fn encode_call_data_to( &self, metadata: &Metadata, out: &mut Vec<u8>, ) -> Result<(), Error>

Source§

fn encode_call_data(&self, metadata: &Metadata) -> Result<Vec<u8>, Error>

Source§

fn validation_details(&self) -> Option<ValidationDetails<'_>>

Source§

impl<T> Payload for Arc<T>
where T: Payload + ?Sized,

Source§

fn encode_call_data_to( &self, metadata: &Metadata, out: &mut Vec<u8>, ) -> Result<(), Error>

Source§

fn encode_call_data(&self, metadata: &Metadata) -> Result<Vec<u8>, Error>

Source§

fn validation_details(&self) -> Option<ValidationDetails<'_>>

Implementors§

Source§

impl Payload for CallData

Source§

impl<CallData> Payload for DefaultPayload<CallData>
where CallData: EncodeAsFields,