pub struct SignerPda<'a, 'b> {
pub pda: Pubkey,
pub bump: [u8; 1],
pub seeds: &'b [&'a [u8]],
}Expand description
PDA with easy access to its signer seeds.
Fields§
§pda: Pubkey§bump: [u8; 1]§seeds: &'b [&'a [u8]]Implementations§
Source§impl<'a, 'b> SignerPda<'a, 'b>
impl<'a, 'b> SignerPda<'a, 'b>
Sourcepub fn new_checked(
seeds: &'b [&'a [u8]],
program_id: &Pubkey,
expected: &AccountInfo<'_>,
) -> Result<Self, ProgramError>
pub fn new_checked( seeds: &'b [&'a [u8]], program_id: &Pubkey, expected: &AccountInfo<'_>, ) -> Result<Self, ProgramError>
Computes a new PDA and checks whether it matches the expected address.
Sourcepub fn check_owner(
seeds: &'b [&'a [u8]],
program_id: &Pubkey,
owner: &Pubkey,
expected: &AccountInfo<'_>,
) -> Result<(), ProgramError>
pub fn check_owner( seeds: &'b [&'a [u8]], program_id: &Pubkey, owner: &Pubkey, expected: &AccountInfo<'_>, ) -> Result<(), ProgramError>
Checks whether there’s an existing PDA account with the provided owner.
Sourcepub fn signer_seeds(&'a self) -> Vec<&'a [u8]>
pub fn signer_seeds(&'a self) -> Vec<&'a [u8]>
Returns the signer seeds (seeds + bump seed) of the PDA.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'b> Freeze for SignerPda<'a, 'b>
impl<'a, 'b> RefUnwindSafe for SignerPda<'a, 'b>
impl<'a, 'b> Send for SignerPda<'a, 'b>
impl<'a, 'b> Sync for SignerPda<'a, 'b>
impl<'a, 'b> Unpin for SignerPda<'a, 'b>
impl<'a, 'b> UnsafeUnpin for SignerPda<'a, 'b>
impl<'a, 'b> UnwindSafe for SignerPda<'a, 'b>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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