pub trait AnchorCPIEventsAccess<'a> {
// Required methods
fn slot(&self) -> Result<u64, DecodeError>;
fn index(&self) -> Result<Option<usize>, DecodeError>;
fn signature(&self) -> Result<&Signature, DecodeError>;
fn next_event<T>(&mut self) -> Result<Option<T>, DecodeError>
where T: Decode;
}
Expand description
Access a Anchor CPI Event.
Required Methods§
Sourcefn slot(&self) -> Result<u64, DecodeError>
fn slot(&self) -> Result<u64, DecodeError>
Get the slot of the transaction where the events were generated.
Sourcefn index(&self) -> Result<Option<usize>, DecodeError>
fn index(&self) -> Result<Option<usize>, DecodeError>
Get the index in the block of the transaction where the events were generated.
§Note
The index
may be None
because for old transaction info format,
the index
of the transaction is not provided.
Sourcefn signature(&self) -> Result<&Signature, DecodeError>
fn signature(&self) -> Result<&Signature, DecodeError>
Get the signature of the transaction where the events were generated.
Sourcefn next_event<T>(&mut self) -> Result<Option<T>, DecodeError>where
T: Decode,
fn next_event<T>(&mut self) -> Result<Option<T>, DecodeError>where
T: Decode,
Decode next event.
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.