#[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_depth | max_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
impl ConcurrentMerkleTreeHeader
pub fn initialize( &mut self, max_depth: u32, max_buffer_size: u32, authority: &Pubkey, creation_slot: u64, )
sourcepub fn initialize_batched(
&mut self,
max_depth: u32,
max_buffer_size: u32,
authority: &Pubkey,
creation_slot: u64,
)
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.
pub fn get_max_depth(&self) -> u32
pub fn get_max_buffer_size(&self) -> u32
pub fn get_creation_slot(&self) -> u64
pub fn get_is_batch_initialized(&self) -> bool
pub fn assert_valid(&self) -> Result<()>
pub fn assert_valid_leaf_index(&self, leaf_index: u32) -> Result<()>
pub fn assert_is_batch_initialized(&self) -> Result<()>
Trait Implementations§
source§impl BorshDeserialize for ConcurrentMerkleTreeHeader
impl BorshDeserialize for ConcurrentMerkleTreeHeader
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
source§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.
source§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,
Auto Trait Implementations§
impl Freeze for ConcurrentMerkleTreeHeader
impl RefUnwindSafe for ConcurrentMerkleTreeHeader
impl Send for ConcurrentMerkleTreeHeader
impl Sync for ConcurrentMerkleTreeHeader
impl Unpin for ConcurrentMerkleTreeHeader
impl UnwindSafe for ConcurrentMerkleTreeHeader
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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