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:

  1. [writable] Allocation tracker PDA. The PDA is derived using the seed ["allocation", allocation id, candy guard pubkey, candy machine pubkey].

Fields§

§id: u8

Unique identifier of the allocation.

§limit: u32

The limit of the allocation.

Trait Implementations§

source§

impl BorshDeserialize for Allocation

source§

fn deserialize_reader<R: Read>(reader: &mut R) -> 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>

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

source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>

§

fn try_to_vec(&self) -> Result<Vec<u8>, Error>

Serialize this instance into a vector of bytes.
source§

impl Clone for Allocation

source§

fn clone(&self) -> Allocation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Condition for Allocation

source§

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<()>

Perform the action associated with the guard before the CPI mint instruction. Read more
source§

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 more
source§

impl Debug for Allocation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Guard for Allocation

source§

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:

  1. [writable] Pda to track the number of mints (seeds ["allocation", allocation id, candy guard pubkey, candy machine pubkey]).
  2. [signer] Candy Guard authority.
  3. [] System program account.
source§

fn size() -> usize

Returns the number of bytes used by the guard configuration.
source§

fn mask() -> u64

Returns the feature mask for the guard.
source§

fn is_enabled(features: u64) -> bool

Returns whether the guards is enabled or not on the specified features.
source§

fn enable(features: u64) -> u64

Enables the guard on the specified features value.
source§

fn disable(features: u64) -> u64

Disables the guard on the specified features value.
source§

fn save(&self, data: &mut [u8], offset: usize) -> Result<()>

Serializes the guard into the specified data array.
source§

fn load(data: &[u8], offset: usize) -> Result<Option<Self>>

Deserializes the guard from a slice of data. Only attempts the deserialization if the data slice is large enough.
source§

fn verify(_data: &CandyGuardData) -> Result<()>

Verifies that the candy guard configuration is valid according to the rules of the guard.

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> AbiExample for T

§

default fn example() -> T

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V