pub enum PubkeyData {
Uninitialized,
InstructionData {
index: u8,
},
AccountData {
account_index: u8,
data_index: u8,
},
}
Expand description
Enum to describe a required key stored in some data.
Variants§
Uninitialized
Uninitialized configuration byte space.
InstructionData
A pubkey to be resolved from the instruction data.
Packed as: * 1 - Discriminator * 1 - Start index of instruction data
Note: Length is always 32 bytes.
AccountData
A pubkey to be resolved from the inner data of some account.
Packed as: * 1 - Discriminator * 1 - Index of account in accounts list * 1 - Start index of account data
Note: Length is always 32 bytes.
Implementations§
source§impl PubkeyData
impl PubkeyData
sourcepub fn pack(&self, dst: &mut [u8]) -> Result<(), ProgramError>
pub fn pack(&self, dst: &mut [u8]) -> Result<(), ProgramError>
Packs a pubkey data configuration into a slice.
sourcepub fn pack_into_address_config(
key_data: &Self,
) -> Result<[u8; 32], ProgramError>
pub fn pack_into_address_config( key_data: &Self, ) -> Result<[u8; 32], ProgramError>
Packs a pubkey data configuration into a 32-byte array, filling the rest with 0s.
sourcepub fn unpack(bytes: &[u8]) -> Result<Self, ProgramError>
pub fn unpack(bytes: &[u8]) -> Result<Self, ProgramError>
Unpacks a pubkey data configuration from a slice.
Trait Implementations§
source§impl Clone for PubkeyData
impl Clone for PubkeyData
source§fn clone(&self) -> PubkeyData
fn clone(&self) -> PubkeyData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PubkeyData
impl Debug for PubkeyData
source§impl PartialEq for PubkeyData
impl PartialEq for PubkeyData
source§fn eq(&self, other: &PubkeyData) -> bool
fn eq(&self, other: &PubkeyData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for PubkeyData
Auto Trait Implementations§
impl Freeze for PubkeyData
impl RefUnwindSafe for PubkeyData
impl Send for PubkeyData
impl Sync for PubkeyData
impl Unpin for PubkeyData
impl UnwindSafe for PubkeyData
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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