Struct solana_sdk::message::Message
source · [−]pub struct Message {
pub header: MessageHeader,
pub account_keys: Vec<Pubkey, Global>,
pub recent_blockhash: Hash,
pub instructions: Vec<CompiledInstruction, Global>,
}
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, Global>
All the account keys used by this transaction
recent_blockhash: Hash
The id of a recent ledger entry.
instructions: Vec<CompiledInstruction, Global>
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, Global>,
recent_blockhash: Hash,
instructions: Vec<CompiledInstruction, Global>
) -> Message
pub fn new(instructions: &[Instruction], payer: Option<&Pubkey>) -> Message
pub fn new_with_blockhash(
instructions: &[Instruction],
payer: Option<&Pubkey>,
blockhash: &Hash
) -> Message
pub fn new_with_nonce(
instructions: Vec<Instruction, Global>,
payer: Option<&Pubkey>,
nonce_account_pubkey: &Pubkey,
nonce_authority_pubkey: &Pubkey
) -> Message
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, Global>ⓘ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, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn is_key_passed_to_program(&self, key_index: usize) -> bool
pub fn is_key_called_as_program(&self, key_index: usize) -> bool
pub fn is_non_loader_key(&self, 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) -> bool
pub fn is_signer(&self, i: usize) -> bool
pub fn get_account_keys_by_lock_type(
&self
) -> (Vec<&Pubkey, Global>, Vec<&Pubkey, Global>)
pub fn deserialize_instruction(
index: usize,
data: &[u8]
) -> Result<Instruction, SanitizeError>
pub fn signer_keys(&self) -> Vec<&Pubkey, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub fn has_duplicates(&self) -> bool
pub fn has_duplicates(&self) -> bool
Return true if account_keys has any duplicate keys
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<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
sourcepub fn deserialize<__D>(
__deserializer: __D
) -> Result<Message, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Message, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl FromWasmAbi for Message
impl FromWasmAbi for Message
sourceimpl IntoWasmAbi for Message
impl IntoWasmAbi for Message
sourceimpl OptionFromWasmAbi for Message
impl OptionFromWasmAbi for Message
sourceimpl OptionIntoWasmAbi for Message
impl OptionIntoWasmAbi for Message
sourceimpl RefFromWasmAbi for Message
impl RefFromWasmAbi for Message
type Anchor = Ref<'static, Message>
type Anchor = Ref<'static, Message>
The type that holds the reference to Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read more
sourcepub unsafe fn ref_from_abi(
js: <Message as RefFromWasmAbi>::Abi
) -> <Message as RefFromWasmAbi>::Anchor
pub unsafe fn ref_from_abi(
js: <Message as RefFromWasmAbi>::Abi
) -> <Message as RefFromWasmAbi>::Anchor
Recover a Self::Anchor
from Self::Abi
. Read more
sourceimpl RefMutFromWasmAbi for Message
impl RefMutFromWasmAbi for Message
sourcepub unsafe fn ref_mut_from_abi(
js: <Message as RefMutFromWasmAbi>::Abi
) -> <Message as RefMutFromWasmAbi>::Anchor
pub unsafe fn ref_mut_from_abi(
js: <Message as RefMutFromWasmAbi>::Abi
) -> <Message as RefMutFromWasmAbi>::Anchor
Same as RefFromWasmAbi::ref_from_abi
sourceimpl Serialize for Message
impl Serialize for Message
sourcepub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl TryFrom<Message> for SanitizedMessage
impl TryFrom<Message> for SanitizedMessage
type Error = SanitizeMessageError
type Error = SanitizeMessageError
The type returned in the event of a conversion error.
sourcepub fn try_from(
message: Message
) -> Result<SanitizedMessage, <SanitizedMessage as TryFrom<Message>>::Error>
pub fn try_from(
message: Message
) -> Result<SanitizedMessage, <SanitizedMessage as TryFrom<Message>>::Error>
Performs the conversion.
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 + ?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> 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> 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> ReturnWasmAbi for T where
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
sourcepub fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
pub fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. 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)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more