Struct solana_program::message::Message
source · [−]pub struct Message {
pub header: MessageHeader,
pub account_keys: Vec<Pubkey>,
pub recent_blockhash: Hash,
pub instructions: Vec<CompiledInstruction>,
}
Fields
header: MessageHeader
The message header, identifying signed and read-only account_keys
NOTE: Serialization-related changes must be paired with the direct read at sigverify.
account_keys: Vec<Pubkey>
All the account keys used by this transaction
recent_blockhash: Hash
The id of a recent ledger entry.
instructions: Vec<CompiledInstruction>
Programs that will be executed in sequence and committed in one atomic transaction if all succeed.
Implementations
sourceimpl Message
impl Message
pub fn new_with_compiled_instructions(
num_required_signatures: u8,
num_readonly_signed_accounts: u8,
num_readonly_unsigned_accounts: u8,
account_keys: Vec<Pubkey>,
recent_blockhash: Hash,
instructions: Vec<CompiledInstruction>
) -> Self
pub fn new(instructions: &[Instruction], payer: Option<&Pubkey>) -> Self
pub fn new_with_nonce(
instructions: Vec<Instruction>,
payer: Option<&Pubkey>,
nonce_account_pubkey: &Pubkey,
nonce_authority_pubkey: &Pubkey
) -> Self
sourcepub fn hash_raw_message(message_bytes: &[u8]) -> Hash
pub fn hash_raw_message(message_bytes: &[u8]) -> Hash
Compute the blake3 hash of a raw transaction message
pub fn compile_instruction(&self, ix: &Instruction) -> CompiledInstruction
pub fn serialize(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn program_id(&self, instruction_index: usize) -> Option<&Pubkey>
pub fn program_index(&self, instruction_index: usize) -> Option<usize>
pub fn program_ids(&self) -> Vec<&Pubkey>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn is_key_called_as_program(&self, key_index: usize) -> bool
pub fn is_key_passed_to_program(&self, index: usize) -> bool
pub fn is_non_loader_key(&self, key: &Pubkey, key_index: usize) -> bool
pub fn program_position(&self, index: usize) -> Option<usize>
pub fn maybe_executable(&self, i: usize) -> bool
pub fn is_writable(&self, i: usize, demote_program_write_locks: bool) -> bool
pub fn is_signer(&self, i: usize) -> bool
pub fn get_account_keys_by_lock_type(
&self,
demote_program_write_locks: bool
) -> (Vec<&Pubkey>, Vec<&Pubkey>)
pub fn serialize_instructions(
&self,
demote_program_write_locks: bool
) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn deserialize_instruction(
index: usize,
data: &[u8]
) -> Result<Instruction, SanitizeError>
pub fn signer_keys(&self) -> Vec<&Pubkey>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub fn is_upgradeable_loader_present(&self) -> bool
pub fn is_upgradeable_loader_present(&self) -> bool
Returns true if any account is the bpf upgradeable loader
Trait Implementations
sourceimpl AbiExample for Message
impl AbiExample for Message
sourceimpl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Message
impl StructuralEq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more