#[repr(C)]pub struct Compression {
pub mode: CompressionMode,
pub amount: u64,
pub mint: u8,
pub source_or_recipient: u8,
pub authority: u8,
pub pool_account_index: u8,
pub pool_index: u8,
pub bump: u8,
pub decimals: u8,
}Fields§
§mode: CompressionMode§amount: u64§mint: u8§source_or_recipient: u8§pool_account_index: u8pool account index for spl token Compression/Decompression rent_sponsor_index for CompressAndClose
pool_index: u8pool index for spl token Compression/Decompression compressed account index for CompressAndClose
bump: u8§decimals: u8decimals for spl token Compression/Decompression (used in transfer_checked) rent_sponsor_is_signer flag for CompressAndClose (non-zero = true)
Implementations§
Source§impl Compression
impl Compression
pub fn compress_and_close( amount: u64, mint: u8, source: u8, authority: u8, rent_sponsor_index: u8, compressed_account_index: u8, destination_index: u8, ) -> Self
pub fn compress_spl( amount: u64, mint: u8, source: u8, authority: u8, pool_account_index: u8, pool_index: u8, bump: u8, decimals: u8, ) -> Self
pub fn compress(amount: u64, mint: u8, source: u8, authority: u8) -> Self
pub fn decompress_spl( amount: u64, mint: u8, recipient: u8, pool_account_index: u8, pool_index: u8, bump: u8, decimals: u8, ) -> Self
pub fn decompress(amount: u64, mint: u8, recipient: u8) -> Self
Trait Implementations§
Source§impl BorshDeserialize for Compression
impl BorshDeserialize for Compression
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,
Source§impl BorshSerialize for Compression
impl BorshSerialize for Compression
Source§impl Clone for Compression
impl Clone for Compression
Source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
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 Debug for Compression
impl Debug for Compression
Source§impl PartialEq for Compression
impl PartialEq for Compression
Source§impl<'a> ZeroCopyAt<'a> for Compression
impl<'a> ZeroCopyAt<'a> for Compression
type ZeroCopyAt = ZCompression<'a>
fn zero_copy_at( __remaining_bytes: &'a [u8], ) -> Result<(Self::ZeroCopyAt, &'a [u8]), ZeroCopyError>
Source§impl<'a> ZeroCopyAtMut<'a> for Compression
impl<'a> ZeroCopyAtMut<'a> for Compression
type ZeroCopyAtMut = ZCompressionMut<'a>
fn zero_copy_at_mut( __remaining_bytes: &'a mut [u8], ) -> Result<(Self::ZeroCopyAtMut, &'a mut [u8]), ZeroCopyError>
Source§impl<'a> ZeroCopyNew<'a> for Compression
impl<'a> ZeroCopyNew<'a> for Compression
Source§type ZeroCopyConfig = CompressionConfig
type ZeroCopyConfig = CompressionConfig
Configuration type needed to initialize this type
Source§type Output = <Compression as ZeroCopyAtMut<'a>>::ZeroCopyAtMut
type Output = <Compression as ZeroCopyAtMut<'a>>::ZeroCopyAtMut
Output type - the mutable zero-copy view of this type
Source§fn byte_len(config: &Self::ZeroCopyConfig) -> Result<usize, ZeroCopyError>
fn byte_len(config: &Self::ZeroCopyConfig) -> Result<usize, ZeroCopyError>
Calculate the byte length needed for this type with the given configuration Read more
Source§fn new_zero_copy(
__remaining_bytes: &'a mut [u8],
config: Self::ZeroCopyConfig,
) -> Result<(Self::Output, &'a mut [u8]), ZeroCopyError>
fn new_zero_copy( __remaining_bytes: &'a mut [u8], config: Self::ZeroCopyConfig, ) -> Result<(Self::Output, &'a mut [u8]), ZeroCopyError>
Initialize this type in a mutable byte slice with the given configuration Read more
Source§impl ZeroCopyStructInner for Compression
impl ZeroCopyStructInner for Compression
type ZeroCopyInner = ZCompression<'static>
Source§impl ZeroCopyStructInnerMut for Compression
impl ZeroCopyStructInnerMut for Compression
type ZeroCopyInnerMut = ZCompressionMut<'static>
impl Copy for Compression
impl Eq for Compression
impl StructuralPartialEq for Compression
Auto Trait Implementations§
impl Freeze for Compression
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnwindSafe for Compression
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> HashToFieldSize for Twhere
T: BorshSerialize,
impl<T> HashToFieldSize for Twhere
T: BorshSerialize,
fn hash_to_field_size(&self) -> Result<[u8; 32], HasherError>
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