Struct strategy_vaults::UserInfo
source · [−]pub struct UserInfo {
pub vault: Pubkey,
pub bump: u8,
pub user_account: Pubkey,
pub manager: Pubkey,
pub last_deposit_at: i64,
pub last_withdraw_at: i64,
pub token_a_added: u64,
pub token_a_removed: u64,
pub token_b_added: u64,
pub token_b_removed: u64,
pub lp_tokens_debt: u64,
}Expand description
A UserInfo manages user information related to a vault.
Fields
vault: Pubkeybump: u8user_account: Pubkeymanager: Pubkeylast_deposit_at: i64last_withdraw_at: i64token_a_added: u64token_a_removed: u64token_b_added: u64token_b_removed: u64lp_tokens_debt: u64Implementations
sourceimpl UserInfo
impl UserInfo
pub fn update_deposit_time(&mut self) -> Result<()>
pub fn update_withdraw_time(&mut self) -> Result<()>
pub fn add_liquidity(
&mut self,
token_a_added: u64,
token_b_added: u64
) -> Result<()>
pub fn remove_liquidity(
&mut self,
token_a_removed: u64,
token_b_removed: u64
) -> Result<()>
pub fn add_lp_tokens_debt(&mut self, token_added: u64) -> Result<()>
pub fn remove_lp_tokens_debt(&mut self, token_removed: u64) -> Result<()>
Trait Implementations
sourceimpl AccountDeserialize for UserInfo
impl AccountDeserialize for UserInfo
sourcefn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a Mint account into a token
Account. Read more
sourceimpl AccountSerialize for UserInfo
impl AccountSerialize for UserInfo
sourceimpl BorshDeserialize for UserInfo where
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
impl BorshDeserialize for UserInfo where
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
sourceimpl BorshSerialize for UserInfo where
Pubkey: BorshSerialize,
u8: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
impl BorshSerialize for UserInfo where
Pubkey: BorshSerialize,
u8: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
sourceimpl Discriminator for UserInfo
impl Discriminator for UserInfo
fn discriminator() -> [u8; 8]
sourceimpl Ord for UserInfo
impl Ord for UserInfo
sourceimpl PartialOrd<UserInfo> for UserInfo
impl PartialOrd<UserInfo> for UserInfo
sourcefn partial_cmp(&self, other: &UserInfo) -> Option<Ordering>
fn partial_cmp(&self, other: &UserInfo) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for UserInfo
impl Eq for UserInfo
impl StructuralEq for UserInfo
impl StructuralPartialEq for UserInfo
Auto Trait Implementations
impl RefUnwindSafe for UserInfo
impl Send for UserInfo
impl Sync for UserInfo
impl Unpin for UserInfo
impl UnwindSafe for UserInfo
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more