pub struct MarginAccount {
pub discriminator: [u8; 8],
pub owner: Pubkey,
pub name: [u8; 32],
pub nr: u16,
pub bump: [u8; 1],
pub pools_attached: u32,
pub reserved: [u8; 64],
}Fields§
§discriminator: [u8; 8]§owner: Pubkey§name: [u8; 32]§nr: u16§bump: [u8; 1]§pools_attached: u32§reserved: [u8; 64]Implementations§
Source§impl MarginAccount
impl MarginAccount
pub const LEN: usize = 143usize
Sourcepub const PREFIX: &'static [u8]
pub const PREFIX: &'static [u8]
Prefix values used to generate a PDA for this account.
Values are positional and appear in the following order:
MarginAccount::PREFIX- tswap (
Pubkey) - owner (
Pubkey) - margin_nr (
u16)
pub fn create_pda( tswap: Pubkey, owner: Pubkey, margin_nr: u16, bump: u8, ) -> Result<Pubkey, PubkeyError>
pub fn find_pda(tswap: &Pubkey, owner: &Pubkey, margin_nr: u16) -> (Pubkey, u8)
pub fn from_bytes(data: &[u8]) -> Result<Self, Error>
Trait Implementations§
Source§impl BorshDeserialize for MarginAccountwhere
[u8; 8]: BorshDeserialize,
Pubkey: BorshDeserialize,
[u8; 32]: BorshDeserialize,
u16: BorshDeserialize,
[u8; 1]: BorshDeserialize,
u32: BorshDeserialize,
[u8; 64]: BorshDeserialize,
impl BorshDeserialize for MarginAccountwhere
[u8; 8]: BorshDeserialize,
Pubkey: BorshDeserialize,
[u8; 32]: BorshDeserialize,
u16: BorshDeserialize,
[u8; 1]: BorshDeserialize,
u32: BorshDeserialize,
[u8; 64]: BorshDeserialize,
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 MarginAccountwhere
[u8; 8]: BorshSerialize,
Pubkey: BorshSerialize,
[u8; 32]: BorshSerialize,
u16: BorshSerialize,
[u8; 1]: BorshSerialize,
u32: BorshSerialize,
[u8; 64]: BorshSerialize,
impl BorshSerialize for MarginAccountwhere
[u8; 8]: BorshSerialize,
Pubkey: BorshSerialize,
[u8; 32]: BorshSerialize,
u16: BorshSerialize,
[u8; 1]: BorshSerialize,
u32: BorshSerialize,
[u8; 64]: BorshSerialize,
Source§impl Clone for MarginAccount
impl Clone for MarginAccount
Source§fn clone(&self) -> MarginAccount
fn clone(&self) -> MarginAccount
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 MarginAccount
impl Debug for MarginAccount
Source§impl PartialEq for MarginAccount
impl PartialEq for MarginAccount
Source§impl<'a> TryFrom<&AccountInfo<'a>> for MarginAccount
impl<'a> TryFrom<&AccountInfo<'a>> for MarginAccount
impl Eq for MarginAccount
impl StructuralPartialEq for MarginAccount
Auto Trait Implementations§
impl Freeze for MarginAccount
impl RefUnwindSafe for MarginAccount
impl Send for MarginAccount
impl Sync for MarginAccount
impl Unpin for MarginAccount
impl UnwindSafe for MarginAccount
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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