Enum solana_program::message::VersionedMessage
source · [−]pub enum VersionedMessage {
Legacy(LegacyMessage),
V0(Message),
}
Expand description
Either a legacy message or a v0 message.
Serialization
If the first bit is set, the remaining 7 bits will be used to determine
which message version is serialized starting from version 0
. If the first
is bit is not set, all bytes are used to encode the legacy Message
format.
Variants
Legacy(LegacyMessage)
V0(Message)
Implementations
sourceimpl VersionedMessage
impl VersionedMessage
pub fn sanitize(
&self,
require_static_program_ids: bool
) -> Result<(), SanitizeError>
pub fn header(&self) -> &MessageHeader
pub fn static_account_keys(&self) -> &[Pubkey]
pub fn address_table_lookups(&self) -> Option<&[MessageAddressTableLookup]>
sourcepub fn is_signer(&self, index: usize) -> bool
pub fn is_signer(&self, index: usize) -> bool
Returns true if the account at the specified index signed this message.
sourcepub fn is_maybe_writable(&self, index: usize) -> bool
pub fn is_maybe_writable(&self, index: usize) -> bool
Returns true if the account at the specified index is writable by the instructions in this message. Since dynamically loaded addresses can’t have write locks demoted without loading addresses, this shouldn’t be used in the runtime.
pub fn is_invoked(&self, key_index: usize) -> bool
sourcepub fn is_non_loader_key(&self, key_index: usize) -> bool
pub fn is_non_loader_key(&self, key_index: usize) -> bool
Returns true if the account at the specified index is not invoked as a program or, if invoked, is passed to a program.
pub fn recent_blockhash(&self) -> &Hash
pub fn set_recent_blockhash(&mut self, recent_blockhash: Hash)
sourcepub fn instructions(&self) -> &[CompiledInstruction]
pub fn instructions(&self) -> &[CompiledInstruction]
Program instructions that will be executed in sequence and committed in one atomic transaction if all succeed.
pub fn serialize(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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
Trait Implementations
sourceimpl AbiEnumVisitor for VersionedMessage
impl AbiEnumVisitor for VersionedMessage
fn visit_for_abi(&self, digester: &mut AbiDigester) -> DigestResult
sourceimpl AbiExample for VersionedMessage
impl AbiExample for VersionedMessage
sourceimpl Clone for VersionedMessage
impl Clone for VersionedMessage
sourcefn clone(&self) -> VersionedMessage
fn clone(&self) -> VersionedMessage
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 VersionedMessage
impl Debug for VersionedMessage
sourceimpl Default for VersionedMessage
impl Default for VersionedMessage
sourceimpl<'de> Deserialize<'de> for VersionedMessage
impl<'de> Deserialize<'de> for VersionedMessage
sourcefn deserialize<D>(deserializer: D) -> Result<VersionedMessage, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<VersionedMessage, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<VersionedMessage> for VersionedMessage
impl PartialEq<VersionedMessage> for VersionedMessage
sourcefn eq(&self, other: &VersionedMessage) -> bool
fn eq(&self, other: &VersionedMessage) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &VersionedMessage) -> bool
fn ne(&self, other: &VersionedMessage) -> bool
This method tests for !=
.
sourceimpl Serialize for VersionedMessage
impl Serialize for VersionedMessage
sourceimpl TryFrom<VersionedMessage> for SanitizedVersionedMessage
impl TryFrom<VersionedMessage> for SanitizedVersionedMessage
type Error = SanitizeError
type Error = SanitizeError
The type returned in the event of a conversion error.
sourcefn try_from(message: VersionedMessage) -> Result<Self, Self::Error>
fn try_from(message: VersionedMessage) -> Result<Self, Self::Error>
Performs the conversion.
impl Eq for VersionedMessage
impl StructuralEq for VersionedMessage
impl StructuralPartialEq for VersionedMessage
Auto Trait Implementations
impl RefUnwindSafe for VersionedMessage
impl Send for VersionedMessage
impl Sync for VersionedMessage
impl Unpin for VersionedMessage
impl UnwindSafe for VersionedMessage
Blanket Implementations
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> 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> 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