agave_transaction_view::transaction_view

Struct TransactionView

Source
pub struct TransactionView<const SANITIZED: bool, D: TransactionData> { /* private fields */ }
Expand description

A view into a serialized transaction.

This struct provides access to the transaction data without deserializing it. This is done by parsing and caching metadata about the layout of the serialized transaction. The owned data is abstracted through the TransactionData trait, so that different containers for the serialized transaction can be used.

Implementations§

Source§

impl<D: TransactionData> TransactionView<false, D>

Source

pub fn try_new_unsanitized(data: D) -> Result<Self>

Creates a new TransactionView without running sanitization checks.

Source

pub fn sanitize(self) -> Result<SanitizedTransactionView<D>>

Sanitizes the transaction view, returning a sanitized view on success.

Source§

impl<D: TransactionData> TransactionView<true, D>

Source

pub fn try_new_sanitized(data: D) -> Result<Self>

Creates a new TransactionView, running sanitization checks.

Source§

impl<const SANITIZED: bool, D: TransactionData> TransactionView<SANITIZED, D>

Source

pub fn num_signatures(&self) -> u8

Return the number of signatures in the transaction.

Source

pub fn version(&self) -> TransactionVersion

Return the version of the transaction.

Source

pub fn num_required_signatures(&self) -> u8

Return the number of required signatures in the transaction.

Source

pub fn num_readonly_signed_static_accounts(&self) -> u8

Return the number of readonly signed static accounts in the transaction.

Source

pub fn num_readonly_unsigned_static_accounts(&self) -> u8

Return the number of readonly unsigned static accounts in the transaction.

Source

pub fn num_static_account_keys(&self) -> u8

Return the number of static account keys in the transaction.

Source

pub fn num_instructions(&self) -> u16

Return the number of instructions in the transaction.

Source

pub fn num_address_table_lookups(&self) -> u8

Return the number of address table lookups in the transaction.

Source

pub fn total_writable_lookup_accounts(&self) -> u16

Return the number of writable lookup accounts in the transaction.

Source

pub fn total_readonly_lookup_accounts(&self) -> u16

Return the number of readonly lookup accounts in the transaction.

Source

pub fn signatures(&self) -> &[Signature]

Return the slice of signatures in the transaction.

Source

pub fn static_account_keys(&self) -> &[Pubkey]

Return the slice of static account keys in the transaction.

Source

pub fn recent_blockhash(&self) -> &Hash

Return the recent blockhash in the transaction.

Source

pub fn instructions_iter(&self) -> InstructionsIterator<'_>

Return an iterator over the instructions in the transaction.

Source

pub fn address_table_lookup_iter(&self) -> AddressTableLookupIterator<'_>

Return an iterator over the address table lookups in the transaction.

Source

pub fn data(&self) -> &[u8]

Return the full serialized transaction data.

Source

pub fn message_data(&self) -> &[u8]

Return the serialized message data. This does not include the signatures.

Source§

impl<D: TransactionData> TransactionView<true, D>

Source

pub fn program_instructions_iter( &self, ) -> impl Iterator<Item = (&Pubkey, SVMInstruction<'_>)>

Return an iterator over the instructions paired with their program ids.

Trait Implementations§

Source§

impl<const SANITIZED: bool, D: TransactionData> Debug for TransactionView<SANITIZED, D>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<const SANITIZED: bool, D> Freeze for TransactionView<SANITIZED, D>
where D: Freeze,

§

impl<const SANITIZED: bool, D> RefUnwindSafe for TransactionView<SANITIZED, D>
where D: RefUnwindSafe,

§

impl<const SANITIZED: bool, D> Send for TransactionView<SANITIZED, D>
where D: Send,

§

impl<const SANITIZED: bool, D> Sync for TransactionView<SANITIZED, D>
where D: Sync,

§

impl<const SANITIZED: bool, D> Unpin for TransactionView<SANITIZED, D>
where D: Unpin,

§

impl<const SANITIZED: bool, D> UnwindSafe for TransactionView<SANITIZED, D>
where D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V