pub enum RecordInstruction<'a> {
Initialize,
Write {
offset: u64,
data: &'a [u8],
},
SetAuthority,
CloseAccount,
Reallocate {
data_length: u64,
},
}Expand description
Instructions supported by the program
Variants§
Initialize
Create a new record
Accounts expected by this instruction:
[writable]Record account, must be uninitialized[]Record authority
Write
Write to the provided record account
Accounts expected by this instruction:
[writable]Record account, must be previously initialized[signer]Current record authority
Fields
SetAuthority
Update the authority of the provided record account
Accounts expected by this instruction:
[writable]Record account, must be previously initialized[signer]Current record authority[]New record authority
CloseAccount
Close the provided record account, draining lamports to recipient account
Accounts expected by this instruction:
[writable]Record account, must be previously initialized[signer]Record authority[]Receiver of account lamports
Reallocate
Reallocate additional space in a record account
If the record account already has enough space to hold the specified data length, then the instruction does nothing.
Accounts expected by this instruction:
[writable]The record account to reallocate[signer]The account’s owner
Implementations§
Source§impl<'a> RecordInstruction<'a>
impl<'a> RecordInstruction<'a>
Sourcepub fn unpack(input: &'a [u8]) -> Result<Self, ProgramError>
pub fn unpack(input: &'a [u8]) -> Result<Self, ProgramError>
Unpacks a byte buffer into a RecordInstruction.
Trait Implementations§
Source§impl<'a> Clone for RecordInstruction<'a>
impl<'a> Clone for RecordInstruction<'a>
Source§fn clone(&self) -> RecordInstruction<'a>
fn clone(&self) -> RecordInstruction<'a>
Returns a duplicate 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<'a> Debug for RecordInstruction<'a>
impl<'a> Debug for RecordInstruction<'a>
Source§impl<'a> PartialEq for RecordInstruction<'a>
impl<'a> PartialEq for RecordInstruction<'a>
impl<'a> StructuralPartialEq for RecordInstruction<'a>
Auto Trait Implementations§
impl<'a> Freeze for RecordInstruction<'a>
impl<'a> RefUnwindSafe for RecordInstruction<'a>
impl<'a> Send for RecordInstruction<'a>
impl<'a> Sync for RecordInstruction<'a>
impl<'a> Unpin for RecordInstruction<'a>
impl<'a> UnwindSafe for RecordInstruction<'a>
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