pub trait Visitor: Sized {
type Value;
// Provided methods
fn visit_account(
self,
account: impl AccountAccess,
) -> Result<Self::Value, DecodeError> { ... }
fn visit_anchor_cpi_events<'a>(
self,
events: impl AnchorCPIEventsAccess<'a>,
) -> Result<Self::Value, DecodeError> { ... }
fn visit_owned_data(
self,
program_id: &Pubkey,
data: &[u8],
) -> Result<Self::Value, DecodeError> { ... }
fn visit_bytes(self, data: &[u8]) -> Result<Self::Value, DecodeError> { ... }
}
Expand description
Type that walks through a Decoder
.
Required Associated Types§
Provided Methods§
Sourcefn visit_account(
self,
account: impl AccountAccess,
) -> Result<Self::Value, DecodeError>
fn visit_account( self, account: impl AccountAccess, ) -> Result<Self::Value, DecodeError>
Visit an account.
Sourcefn visit_anchor_cpi_events<'a>(
self,
events: impl AnchorCPIEventsAccess<'a>,
) -> Result<Self::Value, DecodeError>
fn visit_anchor_cpi_events<'a>( self, events: impl AnchorCPIEventsAccess<'a>, ) -> Result<Self::Value, DecodeError>
Visit Anchor CPI events.
Sourcefn visit_owned_data(
self,
program_id: &Pubkey,
data: &[u8],
) -> Result<Self::Value, DecodeError>
fn visit_owned_data( self, program_id: &Pubkey, data: &[u8], ) -> Result<Self::Value, DecodeError>
Visit data owned by a program.
It can be the data of an Event
, an Account
or an Instruction
.
Sourcefn visit_bytes(self, data: &[u8]) -> Result<Self::Value, DecodeError>
fn visit_bytes(self, data: &[u8]) -> Result<Self::Value, DecodeError>
Visit bytes.
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.