Struct solana_sdk::message::MessageHeader
source · [−]pub struct MessageHeader {
pub num_required_signatures: u8,
pub num_readonly_signed_accounts: u8,
pub num_readonly_unsigned_accounts: u8,
}
Expand description
Describes the organization of a Message
’s account keys.
Every Instruction
specifies which accounts it may reference, or
otherwise requires specific permissions of. Those specifications are:
whether the account is read-only, or read-write; and whether the account
must have signed the transaction containing the instruction.
Whereas individual Instruction
s contain a list of all accounts they may
access, along with their required permissions, a Message
contains a
single shared flat list of all accounts required by all instructions in
a transaction. When building a Message
, this flat list is created and
Instruction
s are converted to CompiledInstruction
s. Those
CompiledInstruction
s then reference by index the accounts they require in
the single shared account list.
The shared account list is ordered by the permissions required of the accounts:
- accounts that are writable and signers
- accounts that are read-only and signers
- accounts that are writable and not signers
- accounts that are read-only and not signers
Given this ordering, the fields of MessageHeader
describe which accounts
in a transaction require which permissions.
When multiple transactions access the same read-only accounts, the runtime may process them in parallel, in a single PoH entry. Transactions that access the same read-write accounts are processed sequentially.
Fields
num_required_signatures: u8
The number of signatures required for this message to be considered
valid. The signers of those signatures must match the first
num_required_signatures
of Message::account_keys
.
num_readonly_signed_accounts: u8
The last num_readonly_signed_accounts
of the signed keys are read-only
accounts.
num_readonly_unsigned_accounts: u8
The last num_readonly_unsigned_accounts
of the unsigned keys are
read-only accounts.
Trait Implementations
sourceimpl AbiExample for MessageHeader
impl AbiExample for MessageHeader
fn example() -> MessageHeader
sourceimpl Clone for MessageHeader
impl Clone for MessageHeader
sourcefn clone(&self) -> MessageHeader
fn clone(&self) -> MessageHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MessageHeader
impl Debug for MessageHeader
sourceimpl Default for MessageHeader
impl Default for MessageHeader
sourcefn default() -> MessageHeader
fn default() -> MessageHeader
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for MessageHeader
impl<'de> Deserialize<'de> for MessageHeader
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<MessageHeader, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<MessageHeader, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<MessageHeader> for MessageHeader
impl PartialEq<MessageHeader> for MessageHeader
sourcefn eq(&self, other: &MessageHeader) -> bool
fn eq(&self, other: &MessageHeader) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MessageHeader) -> bool
fn ne(&self, other: &MessageHeader) -> bool
This method tests for !=
.
sourceimpl Serialize for MessageHeader
impl Serialize for MessageHeader
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
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
impl Copy for MessageHeader
impl Eq for MessageHeader
impl StructuralEq for MessageHeader
impl StructuralPartialEq for MessageHeader
Auto Trait Implementations
impl RefUnwindSafe for MessageHeader
impl Send for MessageHeader
impl Sync for MessageHeader
impl Unpin for MessageHeader
impl UnwindSafe for MessageHeader
Blanket Implementations
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
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,
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 · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more