spl_account_compression::state

Struct ConcurrentMerkleTreeHeader

source
#[repr(C)]
pub struct ConcurrentMerkleTreeHeader { pub account_type: CompressionAccountType, pub header: ConcurrentMerkleTreeHeaderData, }
Expand description

Initialization parameters for an SPL ConcurrentMerkleTree.

Only the following permutations are valid:

max_depthmax_buffer_size
14(64, 256, 1024, 2048)
20(64, 256, 1024, 2048)
24(64, 256, 512, 1024, 2048)
26(64, 256, 512, 1024, 2048)
30(512, 1024, 2048)

Fields§

§account_type: CompressionAccountType

Account type

§header: ConcurrentMerkleTreeHeaderData

Versioned header

Implementations§

source§

impl ConcurrentMerkleTreeHeader

source

pub fn initialize( &mut self, max_depth: u32, max_buffer_size: u32, authority: &Pubkey, creation_slot: u64, )

source

pub fn initialize_batched( &mut self, max_depth: u32, max_buffer_size: u32, authority: &Pubkey, creation_slot: u64, )

Initializes the header with the given parameters and sets the is_batch_initialized flag to true.

source

pub fn get_max_depth(&self) -> u32

source

pub fn get_max_buffer_size(&self) -> u32

source

pub fn get_creation_slot(&self) -> u64

source

pub fn get_is_batch_initialized(&self) -> bool

source

pub fn set_new_authority(&mut self, new_authority: &Pubkey)

source

pub fn assert_valid(&self) -> Result<()>

source

pub fn assert_valid_authority(&self, expected_authority: &Pubkey) -> Result<()>

source

pub fn assert_valid_leaf_index(&self, leaf_index: u32) -> Result<()>

source

pub fn assert_is_batch_initialized(&self) -> Result<()>

Trait Implementations§

source§

impl BorshDeserialize for ConcurrentMerkleTreeHeader

source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>

source§

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

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

source§

impl BorshSerialize for ConcurrentMerkleTreeHeader

source§

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

source§

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

Serialize this instance into a vector of bytes.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> AbiExample for T

source§

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.

source§

impl<T> IntoEither for T

source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

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

Initializes a with the given initializer. Read more
source§

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

Dereferences the given pointer. Read more
source§

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

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = 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>,

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

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

source§

fn vzip(self) -> V