Skip to main content

CreateBuffers

Struct CreateBuffers 

Source
pub struct CreateBuffers<'a> {
    pub program_id: Pubkey,
    pub payer: Pubkey,
    pub buffers: &'a [(Pubkey, Pubkey)],
}
Expand description

Builder for a CreateBuffer instruction that creates one buffer per (buffer_pda, mint) pair in buffers.

Each buffer_pda must be the canonical PDA returned by crate::pda::buffer::find_buffer_pda for its mint; the program derives the bump itself and rejects any other address. payer funds every new token account’s rent.

Buffer creation is idempotent: an already-existing buffer_pda is left unchanged and the instruction still succeeds, so two parties racing to create the same buffer both succeed.

Wire format: [discriminator=4], 1 byte. The tokens are implied by the mint accounts, so no further data is needed. Required accounts: [payer (W,S), system_program (R), token_program (R), (buffer_pda (W), mint (R))...]. The three shared accounts come first and are read positionally; the per-buffer pairs follow. The system program only has to be present so the CreateAccount CPI can dispatch; it isn’t read by index.

Fields§

§program_id: Pubkey§payer: Pubkey§buffers: &'a [(Pubkey, Pubkey)]

Trait Implementations§

Source§

impl From<CreateBuffers<'_>> for Instruction

Source§

fn from(builder: CreateBuffers<'_>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for CreateBuffers<'a>

§

impl<'a> RefUnwindSafe for CreateBuffers<'a>

§

impl<'a> Send for CreateBuffers<'a>

§

impl<'a> Sync for CreateBuffers<'a>

§

impl<'a> Unpin for CreateBuffers<'a>

§

impl<'a> UnsafeUnpin for CreateBuffers<'a>

§

impl<'a> UnwindSafe for CreateBuffers<'a>

Blanket Implementations§

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.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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>,

Source§

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.