#[repr(u8)]pub enum CpiGuardInstruction {
Enable = 0,
Disable = 1,
}
Expand description
CPI Guard extension instructions
Variants§
Enable = 0
Lock certain token operations from taking place within CPI for this Account, namely:
- Transfer and Burn must go through a delegate.
- CloseAccount can only return lamports to owner.
- SetAuthority can only be used to remove an existing close authority.
- Approve is disallowed entirely.
In addition, CPI Guard cannot be enabled or disabled via CPI.
Accounts expected by this instruction:
[writable]
The account to update.[signer]
The account’s owner.
- Multisignature authority
[writable]
The account to update.[]
The account’s multisignature owner.- ..2+M
[signer]
M signer accounts.
Disable = 1
Allow all token operations to happen via CPI as normal.
Implicitly initializes the extension in the case where it is not present.
Accounts expected by this instruction:
[writable]
The account to update.[signer]
The account’s owner.
- Multisignature authority
[writable]
The account to update.[]
The account’s multisignature owner.- ..2+M
[signer]
M signer accounts.
Trait Implementations§
source§impl Clone for CpiGuardInstruction
impl Clone for CpiGuardInstruction
source§fn clone(&self) -> CpiGuardInstruction
fn clone(&self) -> CpiGuardInstruction
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 CpiGuardInstruction
impl Debug for CpiGuardInstruction
source§impl From<CpiGuardInstruction> for u8
impl From<CpiGuardInstruction> for u8
source§fn from(enum_value: CpiGuardInstruction) -> Self
fn from(enum_value: CpiGuardInstruction) -> Self
Converts to this type from the input type.
source§impl PartialEq for CpiGuardInstruction
impl PartialEq for CpiGuardInstruction
source§fn eq(&self, other: &CpiGuardInstruction) -> bool
fn eq(&self, other: &CpiGuardInstruction) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<u8> for CpiGuardInstruction
impl TryFrom<u8> for CpiGuardInstruction
§type Error = TryFromPrimitiveError<CpiGuardInstruction>
type Error = TryFromPrimitiveError<CpiGuardInstruction>
The type returned in the event of a conversion error.
source§impl TryFromPrimitive for CpiGuardInstruction
impl TryFromPrimitive for CpiGuardInstruction
type Primitive = u8
type Error = TryFromPrimitiveError<CpiGuardInstruction>
const NAME: &'static str = "CpiGuardInstruction"
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for CpiGuardInstruction
impl StructuralPartialEq for CpiGuardInstruction
Auto Trait Implementations§
impl Freeze for CpiGuardInstruction
impl RefUnwindSafe for CpiGuardInstruction
impl Send for CpiGuardInstruction
impl Sync for CpiGuardInstruction
impl Unpin for CpiGuardInstruction
impl UnwindSafe for CpiGuardInstruction
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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