pub enum VersionedMessage {
Legacy(Message),
V0(Message),
V1(Message),
}Expand description
Either a legacy message, v0 or a v1 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§
Implementations§
Source§impl VersionedMessage
impl VersionedMessage
pub fn sanitize(&self) -> Result<(), SanitizeError>
target_os=solana only.pub fn header(&self) -> &MessageHeader
target_os=solana only.pub fn static_account_keys(&self) -> &[Address]
target_os=solana only.pub fn address_table_lookups(&self) -> Option<&[MessageAddressTableLookup]>
target_os=solana only.Sourcepub fn is_signer(&self, index: usize) -> bool
Available on non-target_os=solana only.
pub fn is_signer(&self, index: usize) -> bool
target_os=solana only.Returns true if the account at the specified index signed this message.
Sourcepub fn is_maybe_writable(
&self,
index: usize,
reserved_account_keys: Option<&HashSet<Address>>,
) -> bool
Available on non-target_os=solana only.
pub fn is_maybe_writable( &self, index: usize, reserved_account_keys: Option<&HashSet<Address>>, ) -> bool
target_os=solana only.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
target_os=solana only.Sourcepub fn is_non_loader_key(&self, key_index: usize) -> bool
Available on non-target_os=solana only.
pub fn is_non_loader_key(&self, key_index: usize) -> bool
target_os=solana only.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
target_os=solana only.pub fn set_recent_blockhash(&mut self, recent_blockhash: Hash)
target_os=solana only.Sourcepub fn instructions(&self) -> &[CompiledInstruction]
Available on non-target_os=solana only.
pub fn instructions(&self) -> &[CompiledInstruction]
target_os=solana only.Program instructions that will be executed in sequence and committed in one atomic transaction if all succeed.
pub fn serialize(&self) -> Vec<u8> ⓘ
target_os=solana and crate feature wincode only.Sourcepub fn hash(&self) -> Hash
Available on crate feature wincode and crate feature blake3 and non-target_os=solana only.
pub fn hash(&self) -> Hash
wincode and crate feature blake3 and non-target_os=solana only.Compute the blake3 hash of this transaction’s message
Sourcepub fn hash_raw_message(message_bytes: &[u8]) -> Hash
Available on non-target_os=solana and crate feature blake3 only.
pub fn hash_raw_message(message_bytes: &[u8]) -> Hash
target_os=solana and crate feature blake3 only.Compute the blake3 hash of a raw transaction message
Trait Implementations§
Source§impl AbiEnumVisitor for VersionedMessage
Available on non-target_os=solana only.
impl AbiEnumVisitor for VersionedMessage
target_os=solana only.fn visit_for_abi(&self, digester: &mut AbiDigester) -> DigestResult
Source§impl AbiExample for VersionedMessage
Available on non-target_os=solana only.
impl AbiExample for VersionedMessage
target_os=solana only.Source§impl Clone for VersionedMessage
Available on non-target_os=solana only.
impl Clone for VersionedMessage
target_os=solana only.Source§fn clone(&self) -> VersionedMessage
fn clone(&self) -> VersionedMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VersionedMessage
Available on non-target_os=solana only.
impl Debug for VersionedMessage
target_os=solana only.Source§impl Default for VersionedMessage
Available on non-target_os=solana only.
impl Default for VersionedMessage
target_os=solana only.Source§impl<'de> Deserialize<'de> for VersionedMessage
Available on non-target_os=solana and crate feature serde only.
impl<'de> Deserialize<'de> for VersionedMessage
target_os=solana and crate feature serde only.Source§fn 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>,
Source§impl PartialEq for VersionedMessage
Available on non-target_os=solana only.
impl PartialEq for VersionedMessage
target_os=solana only.Source§impl<'de, C: Config> SchemaRead<'de, C> for VersionedMessage
Available on non-target_os=solana and crate feature wincode only.
impl<'de, C: Config> SchemaRead<'de, C> for VersionedMessage
target_os=solana and crate feature wincode only.Source§impl<C: Config> SchemaWrite<C> for VersionedMessage
Available on non-target_os=solana and crate feature wincode only.
impl<C: Config> SchemaWrite<C> for VersionedMessage
target_os=solana and crate feature wincode only.Source§impl Serialize for VersionedMessage
Available on non-target_os=solana and crate feature serde only.
impl Serialize for VersionedMessage
target_os=solana and crate feature serde only.Source§impl TryFrom<VersionedMessage> for SanitizedVersionedMessage
Available on non-target_os=solana only.
impl TryFrom<VersionedMessage> for SanitizedVersionedMessage
target_os=solana only.Source§type Error = SanitizeError
type Error = SanitizeError
impl Eq for VersionedMessage
target_os=solana only.impl StructuralPartialEq for VersionedMessage
target_os=solana only.Auto Trait Implementations§
impl Freeze for VersionedMessage
impl RefUnwindSafe for VersionedMessage
impl Send for VersionedMessage
impl Sync for VersionedMessage
impl Unpin for VersionedMessage
impl UnsafeUnpin for VersionedMessage
impl UnwindSafe for VersionedMessage
Blanket Implementations§
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<T> AbiEnumVisitor for Twhere
T: Serialize + AbiExample,
impl<T> AbiEnumVisitor for Twhere
T: Serialize + AbiExample,
default fn visit_for_abi( &self, digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
Source§impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
Source§impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Reader into dst.Source§impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Reader into dst.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, C> Serialize<C> for T
impl<T, C> Serialize<C> for T
Source§fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
alloc only.Vec of bytes.Source§fn serialize_into(
dst: impl Writer,
src: &Self::Src,
config: C,
) -> Result<(), WriteError>
fn serialize_into( dst: impl Writer, src: &Self::Src, config: C, ) -> Result<(), WriteError>
Writer.Source§fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
Source§impl<T> Serialize for T
impl<T> Serialize for T
Source§fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
alloc only.Vec of bytes.