Struct mpl_candy_guard::guards::Allocation
source · pub struct Allocation {
pub id: u8,
pub limit: u32,
}Expand description
Gaurd to specify the maximum number of mints in a guard set.
List of accounts required:
[writable]Allocation tracker PDA. The PDA is derived using the seed["allocation", allocation id, candy guard pubkey, candy machine pubkey].
Fields§
§id: u8Unique identifier of the allocation.
limit: u32The limit of the allocation.
Trait Implementations§
source§impl BorshDeserialize for Allocation
impl BorshDeserialize for Allocation
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 BorshSerialize for Allocation
impl BorshSerialize for Allocation
source§impl Clone for Allocation
impl Clone for Allocation
source§fn clone(&self) -> Allocation
fn clone(&self) -> Allocation
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 Condition for Allocation
impl Condition for Allocation
source§fn validate<'info>(
&self,
ctx: &mut EvaluationContext<'_, '_, '_>,
_guard_set: &GuardSet,
_mint_args: &[u8]
) -> Result<()>
fn validate<'info>( &self, ctx: &mut EvaluationContext<'_, '_, '_>, _guard_set: &GuardSet, _mint_args: &[u8] ) -> Result<()>
Validate the condition of the guard. When the guard condition is
not satisfied, it will return an error. Read more
source§fn pre_actions<'info>(
&self,
ctx: &mut EvaluationContext<'_, '_, '_>,
_guard_set: &GuardSet,
_mint_args: &[u8]
) -> Result<()>
fn pre_actions<'info>( &self, ctx: &mut EvaluationContext<'_, '_, '_>, _guard_set: &GuardSet, _mint_args: &[u8] ) -> Result<()>
Perform the action associated with the guard before the CPI
mint instruction. Read moresource§fn post_actions(
&self,
_ctx: &mut EvaluationContext<'_, '_, '_>,
_guard_set: &GuardSet,
_mint_args: &[u8]
) -> Result<()>
fn post_actions( &self, _ctx: &mut EvaluationContext<'_, '_, '_>, _guard_set: &GuardSet, _mint_args: &[u8] ) -> Result<()>
Perform the action associated with the guard after the CPI
mint instruction. Read moresource§impl Debug for Allocation
impl Debug for Allocation
source§impl Guard for Allocation
impl Guard for Allocation
source§fn instruction<'info>(
ctx: &Context<'_, '_, '_, 'info, Route<'info>>,
route_context: RouteContext<'info>,
_data: Vec<u8>
) -> Result<()>
fn instruction<'info>( ctx: &Context<'_, '_, '_, 'info, Route<'info>>, route_context: RouteContext<'info>, _data: Vec<u8> ) -> Result<()>
Instruction to initialize the allocation PDA.
List of accounts required:
[writable]Pda to track the number of mints (seeds["allocation", allocation id, candy guard pubkey, candy machine pubkey]).[signer]Candy Guard authority.[]System program account.
source§fn is_enabled(features: u64) -> bool
fn is_enabled(features: u64) -> bool
Returns whether the guards is enabled or not on the specified features.
source§fn save(&self, data: &mut [u8], offset: usize) -> Result<()>
fn save(&self, data: &mut [u8], offset: usize) -> Result<()>
Serializes the guard into the specified data array.
Auto Trait Implementations§
impl RefUnwindSafe for Allocation
impl Send for Allocation
impl Sync for Allocation
impl Unpin for Allocation
impl UnwindSafe for Allocation
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