Struct switchboard_solana::attestation_program::accounts::attestation_permission::AttestationPermissionAccountData
source · #[repr(packed(1))]pub struct AttestationPermissionAccountData {
pub authority: Pubkey,
pub permissions: u32,
pub granter: Pubkey,
pub grantee: Pubkey,
pub expiration: i64,
pub bump: u8,
pub _ebuf: [u8; 256],
}
Fields§
§permissions: u32
§granter: Pubkey
§grantee: Pubkey
§expiration: i64
§bump: u8
§_ebuf: [u8; 256]
Implementations§
source§impl AttestationPermissionAccountData
impl AttestationPermissionAccountData
pub fn size() -> usize
sourcepub fn new<'info>(
permission_account_info: &'info AccountInfo<'info>
) -> Result<Ref<'info, AttestationPermissionAccountData>>
pub fn new<'info>( permission_account_info: &'info AccountInfo<'info> ) -> Result<Ref<'info, AttestationPermissionAccountData>>
Returns the deserialized Switchboard AttestationPermission account
§Arguments
permission_account_info
- A Solana AccountInfo referencing an existing Switchboard AttestationPermissionAccount
§Examples
ⓘ
use switchboard_solana::AttestationPermissionAccountData;
let permissions = AttestationPermissionAccountData::new(permission_account_info)?;
sourcepub fn new_from_bytes(data: &[u8]) -> Result<&AttestationPermissionAccountData>
pub fn new_from_bytes(data: &[u8]) -> Result<&AttestationPermissionAccountData>
pub fn has(&self, p: SwitchboardAttestationPermission) -> bool
pub fn fetch(client: &RpcClient, pubkey: Pubkey) -> Result<Self, SbError>
pub async fn fetch_async( client: &RpcClient, pubkey: Pubkey ) -> Result<Self, SbError>
pub fn fetch_sync<T: SyncClient>( client: &T, pubkey: Pubkey ) -> Result<Self, SbError>
pub fn get_pda( authority: &Pubkey, attestation_queue: &Pubkey, grantee: &Pubkey ) -> Pubkey
pub fn verify_pda( expected: &Pubkey, authority: &Pubkey, attestation_queue: &Pubkey, grantee: &Pubkey ) -> Result<()>
Trait Implementations§
source§impl AccountDeserialize for AttestationPermissionAccountData
impl AccountDeserialize for AttestationPermissionAccountData
source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a
Mint
account into a token
Account
.source§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
Deserializes account data without checking the account discriminator.
This should only be used on account initialization, when the bytes of
the account are zeroed.
source§impl BorshDeserialize for AttestationPermissionAccountDatawhere
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
i64: BorshDeserialize,
u8: BorshDeserialize,
[u8; 256]: BorshDeserialize,
impl BorshDeserialize for AttestationPermissionAccountDatawhere
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
i64: BorshDeserialize,
u8: BorshDeserialize,
[u8; 256]: BorshDeserialize,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl Clone for AttestationPermissionAccountData
impl Clone for AttestationPermissionAccountData
source§fn clone(&self) -> AttestationPermissionAccountData
fn clone(&self) -> AttestationPermissionAccountData
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 Discriminator for AttestationPermissionAccountData
impl Discriminator for AttestationPermissionAccountData
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
source§impl Zeroable for AttestationPermissionAccountData
impl Zeroable for AttestationPermissionAccountData
impl Copy for AttestationPermissionAccountData
impl Pod for AttestationPermissionAccountData
impl ZeroCopy for AttestationPermissionAccountData
Auto Trait Implementations§
impl RefUnwindSafe for AttestationPermissionAccountData
impl Send for AttestationPermissionAccountData
impl Sync for AttestationPermissionAccountData
impl Unpin for AttestationPermissionAccountData
impl UnwindSafe for AttestationPermissionAccountData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.