pub struct UserInfo<'a, 'b> {
pub key: &'a Pubkey,
pub data: RefMut<'a, &'b mut [u8]>,
}Fields§
§key: &'a Pubkey§data: RefMut<'a, &'b mut [u8]>Implementations§
Source§impl<'a, 'b> UserInfo<'a, 'b>
impl<'a, 'b> UserInfo<'a, 'b>
pub const LEN: usize = 681usize
pub const LAST_DEPOSIT_INDEX: usize = 0usize
pub const LAST_WITHDRAWAL_INDEX: usize = 1usize
pub const TOKEN_A_ADDED_INDEX: usize = 2usize
pub const TOKEN_A_REMOVED_INDEX: usize = 3usize
pub const TOKEN_B_ADDED_INDEX: usize = 4usize
pub const TOKEN_B_REMOVED_INDEX: usize = 5usize
pub const LP_TOKENS_DEBT_INDEX: usize = 6usize
pub const USER_BUMP_INDEX: usize = 7usize
pub fn new(account: &'a AccountInfo<'b>) -> Self
pub fn init( &mut self, refdb_name: &ArrayString64, user_bump: u8, ) -> ProgramResult
pub fn update_deposit_time(&mut self) -> ProgramResult
pub fn update_withdrawal_time(&mut self) -> ProgramResult
pub fn add_liquidity( &mut self, token_a_added: u64, token_b_added: u64, ) -> ProgramResult
pub fn remove_liquidity( &mut self, token_a_removed: u64, token_b_removed: u64, ) -> ProgramResult
pub fn add_lp_tokens_debt(&mut self, token_added: u64) -> ProgramResult
pub fn remove_lp_tokens_debt(&mut self, token_removed: u64) -> ProgramResult
pub fn get_lp_tokens_debt(&self) -> Result<u64, ProgramError>
pub fn get_deposit_time(&self) -> Result<UnixTimestamp, ProgramError>
pub fn get_withdrawal_time(&self) -> Result<UnixTimestamp, ProgramError>
pub fn get_token_a_added(&self) -> Result<u64, ProgramError>
pub fn get_token_b_added(&self) -> Result<u64, ProgramError>
pub fn get_token_a_removed(&self) -> Result<u64, ProgramError>
pub fn get_token_b_removed(&self) -> Result<u64, ProgramError>
pub fn get_user_bump(&self) -> Result<u8, ProgramError>
pub fn validate_account( vault: &Vault, user_info_account: &'a AccountInfo<'b>, user_account: &Pubkey, ) -> bool
Auto Trait Implementations§
impl<'a, 'b> Freeze for UserInfo<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for UserInfo<'a, 'b>
impl<'a, 'b> !Send for UserInfo<'a, 'b>
impl<'a, 'b> !Sync for UserInfo<'a, 'b>
impl<'a, 'b> Unpin for UserInfo<'a, 'b>
impl<'a, 'b> !UnwindSafe for UserInfo<'a, 'b>
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