pub struct LightAccount<'a, A: AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> {
pub account: A,
/* private fields */
}Fields§
§account: AImplementations§
Source§impl<'a, A: AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> LightAccount<'a, A>
impl<'a, A: AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> LightAccount<'a, A>
pub fn new_init( owner: &'a Pubkey, address: Option<[u8; 32]>, output_state_tree_index: u8, ) -> Self
pub fn new_mut( owner: &'a Pubkey, input_account_meta: &impl CompressedAccountMetaTrait, input_account: A, ) -> Result<Self, LightSdkError>
pub fn new_close( owner: &'a Pubkey, input_account_meta: &impl CompressedAccountMetaTrait, input_account: A, ) -> Result<Self, LightSdkError>
pub fn discriminator(&self) -> &[u8; 8]
pub fn lamports(&self) -> u64
pub fn lamports_mut(&mut self) -> &mut u64
pub fn address(&self) -> &Option<[u8; 32]>
pub fn owner(&self) -> &Pubkey
pub fn in_account_info(&self) -> &Option<InAccountInfo>
pub fn out_account_info(&mut self) -> &Option<OutAccountInfo>
Sourcepub fn to_account_info(self) -> Result<CompressedAccountInfo, LightSdkError>
pub fn to_account_info(self) -> Result<CompressedAccountInfo, LightSdkError>
- Serializes the account data and sets the output data hash.
- Returns CompressedAccountInfo.
Note this is an expensive operation that should only be called once per instruction.
Trait Implementations§
Source§impl<'a, A: Debug + AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> Debug for LightAccount<'a, A>
impl<'a, A: Debug + AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> Debug for LightAccount<'a, A>
Source§impl<A: AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> Deref for LightAccount<'_, A>
impl<A: AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> Deref for LightAccount<'_, A>
Source§impl<A: AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> DerefMut for LightAccount<'_, A>
impl<A: AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> DerefMut for LightAccount<'_, A>
Source§impl<'a, A: PartialEq + AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> PartialEq for LightAccount<'a, A>
impl<'a, A: PartialEq + AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> PartialEq for LightAccount<'a, A>
impl<'a, A: AnchorSerialize + AnchorDeserialize + LightDiscriminator + DataHasher + Default> StructuralPartialEq for LightAccount<'a, A>
Auto Trait Implementations§
impl<'a, A> Freeze for LightAccount<'a, A>where
A: Freeze,
impl<'a, A> RefUnwindSafe for LightAccount<'a, A>where
A: RefUnwindSafe,
impl<'a, A> Send for LightAccount<'a, A>where
A: Send,
impl<'a, A> Sync for LightAccount<'a, A>where
A: Sync,
impl<'a, A> Unpin for LightAccount<'a, A>where
A: Unpin,
impl<'a, A> UnwindSafe for LightAccount<'a, A>where
A: UnwindSafe,
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