pub struct ReserveCollateral {
pub mint_pubkey: Pubkey,
pub mint_total_supply: u64,
pub supply_pubkey: Pubkey,
}Expand description
Reserve collateral
Fields§
§mint_pubkey: PubkeyReserve collateral mint address
mint_total_supply: u64Reserve collateral mint supply, used for exchange rate
supply_pubkey: PubkeyReserve collateral supply address
Implementations§
Source§impl ReserveCollateral
impl ReserveCollateral
Sourcepub fn new(params: NewReserveCollateralParams) -> Self
pub fn new(params: NewReserveCollateralParams) -> Self
Create a new reserve collateral
Sourcepub fn mint(&mut self, collateral_amount: u64) -> ProgramResult
pub fn mint(&mut self, collateral_amount: u64) -> ProgramResult
Add collateral to total supply
Sourcepub fn burn(&mut self, collateral_amount: u64) -> ProgramResult
pub fn burn(&mut self, collateral_amount: u64) -> ProgramResult
Remove collateral from total supply
Trait Implementations§
Source§impl Clone for ReserveCollateral
impl Clone for ReserveCollateral
Source§fn clone(&self) -> ReserveCollateral
fn clone(&self) -> ReserveCollateral
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 ReserveCollateral
impl Debug for ReserveCollateral
Source§impl Default for ReserveCollateral
impl Default for ReserveCollateral
Source§fn default() -> ReserveCollateral
fn default() -> ReserveCollateral
Returns the “default value” for a type. Read more
Source§impl PartialEq for ReserveCollateral
impl PartialEq for ReserveCollateral
impl Eq for ReserveCollateral
impl StructuralPartialEq for ReserveCollateral
Auto Trait Implementations§
impl Freeze for ReserveCollateral
impl RefUnwindSafe for ReserveCollateral
impl Send for ReserveCollateral
impl Sync for ReserveCollateral
impl Unpin for ReserveCollateral
impl UnwindSafe for ReserveCollateral
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> 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