pub struct EscrowSettlement {
pub to_burn: u128,
pub refund: u128,
}Expand description
Settlement result for escrowed shares.
Fields§
§to_burn: u128Shares to burn (successfully redeemed).
refund: u128Shares to refund (excess or on failure).
Implementations§
Source§impl EscrowSettlement
impl EscrowSettlement
Sourcepub fn from_escrow_and_burn(escrow_shares: u128, burn_shares: u128) -> Self
pub fn from_escrow_and_burn(escrow_shares: u128, burn_shares: u128) -> Self
Create a settlement from escrowed shares and intended burned shares.
Burned shares are clamped to escrow_shares, and the remainder is refunded.
Sourcepub fn refund_all(shares: u128) -> Self
pub fn refund_all(shares: u128) -> Self
Create a settlement that refunds all shares.
Trait Implementations§
Source§impl BorshDeserialize for EscrowSettlement
impl BorshDeserialize for EscrowSettlement
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
§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.
§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 EscrowSettlement
impl BorshSerialize for EscrowSettlement
Source§impl Clone for EscrowSettlement
impl Clone for EscrowSettlement
Source§fn clone(&self) -> EscrowSettlement
fn clone(&self) -> EscrowSettlement
Returns a copy 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 EscrowSettlement
impl Debug for EscrowSettlement
Source§impl<'de> Deserialize<'de> for EscrowSettlement
impl<'de> Deserialize<'de> for EscrowSettlement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EscrowSettlement
impl PartialEq for EscrowSettlement
Source§impl Serialize for EscrowSettlement
impl Serialize for EscrowSettlement
impl Copy for EscrowSettlement
impl Eq for EscrowSettlement
impl StructuralPartialEq for EscrowSettlement
Auto Trait Implementations§
impl Freeze for EscrowSettlement
impl RefUnwindSafe for EscrowSettlement
impl Send for EscrowSettlement
impl Sync for EscrowSettlement
impl Unpin for EscrowSettlement
impl UnwindSafe for EscrowSettlement
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