Trait Decoder

Source
pub trait Decoder {
    // Required methods
    fn decode_account<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
       where V: Visitor;
    fn decode_transaction<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
       where V: Visitor;
    fn decode_anchor_cpi_events<V>(
        &self,
        visitor: V,
    ) -> Result<V::Value, DecodeError>
       where V: Visitor;
    fn decode_owned_data<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
       where V: Visitor;
    fn decode_bytes<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
       where V: Visitor;
}
Expand description

Decoder for received program data.

Required Methods§

Source

fn decode_account<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
where V: Visitor,

Hint that the visitor is expecting an AccountInfo.

Source

fn decode_transaction<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
where V: Visitor,

Hint that the visitor is expecting a Transaction.

Source

fn decode_anchor_cpi_events<V>( &self, visitor: V, ) -> Result<V::Value, DecodeError>
where V: Visitor,

Hint that the visitor is expecting AnchorCPIEvent list.

Source

fn decode_owned_data<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
where V: Visitor,

Hint that the visitor is expecting a OwnedData.

It can be the data of an Event of an Instruction.

Source

fn decode_bytes<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
where V: Visitor,

Hint that the visitor is expecting a Data.

It can be the data of an Event of an Instruction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<D: Decoder> Decoder for &D

Source§

fn decode_account<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
where V: Visitor,

Source§

fn decode_transaction<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
where V: Visitor,

Source§

fn decode_anchor_cpi_events<V>( &self, visitor: V, ) -> Result<V::Value, DecodeError>
where V: Visitor,

Source§

fn decode_owned_data<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
where V: Visitor,

Source§

fn decode_bytes<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
where V: Visitor,

Implementors§