pub enum VersionedMessage {
Legacy(Message),
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§
Implementations§
§impl VersionedMessage
impl VersionedMessage
pub fn sanitize(&self) -> Result<(), SanitizeError>
pub fn header(&self) -> &MessageHeader
pub fn static_account_keys(&self) -> &[Pubkey]
pub fn address_table_lookups(&self) -> Option<&[MessageAddressTableLookup]>
pub 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.
pub 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
pub 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)
pub 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> ⓘ
pub 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§
§impl Clone for VersionedMessage
impl Clone for VersionedMessage
§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 more§impl Debug for VersionedMessage
impl Debug for VersionedMessage
§impl Default for VersionedMessage
impl Default for VersionedMessage
§fn default() -> VersionedMessage
fn default() -> VersionedMessage
§impl<'de> Deserialize<'de> for VersionedMessage
impl<'de> Deserialize<'de> for VersionedMessage
§fn deserialize<D>(
deserializer: D
) -> Result<VersionedMessage, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<VersionedMessage, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl PartialEq for VersionedMessage
impl PartialEq for VersionedMessage
§fn eq(&self, other: &VersionedMessage) -> bool
fn eq(&self, other: &VersionedMessage) -> bool
self
and other
values to be equal, and is used
by ==
.§impl Serialize for VersionedMessage
impl Serialize for VersionedMessage
§fn 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,
§impl TryFrom<VersionedMessage> for SanitizedVersionedMessage
impl TryFrom<VersionedMessage> for SanitizedVersionedMessage
§type Error = SanitizeError
type Error = SanitizeError
§fn try_from(
message: VersionedMessage
) -> Result<SanitizedVersionedMessage, <SanitizedVersionedMessage as TryFrom<VersionedMessage>>::Error>
fn try_from( message: VersionedMessage ) -> Result<SanitizedVersionedMessage, <SanitizedVersionedMessage as TryFrom<VersionedMessage>>::Error>
impl Eq for VersionedMessage
impl StructuralPartialEq for VersionedMessage
Auto Trait Implementations§
impl Freeze for VersionedMessage
impl RefUnwindSafe for VersionedMessage
impl Send for VersionedMessage
impl Sync for VersionedMessage
impl Unpin for VersionedMessage
impl UnwindSafe for VersionedMessage
Blanket Implementations§
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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 more