pub struct AssetCapacity {
num_tranches: u32,
tranche_size: Capacity,
}Expand description
Capacity of an asset, expressed in terms of a number of discrete tranches of a given size.
Fields§
§num_tranches: u32Number of tranches
tranche_size: CapacitySize of each tranche
Implementations§
Source§impl AssetCapacity
impl AssetCapacity
Sourcepub fn new(num_tranches: u32, tranche_size: Capacity) -> Self
pub fn new(num_tranches: u32, tranche_size: Capacity) -> Self
Create a new AssetCapacity with the given number of tranches and tranche size
Sourcepub fn single(tranche_size: Capacity) -> Self
pub fn single(tranche_size: Capacity) -> Self
Create a new AssetCapacity with a single tranche of the given size
Sourcepub fn min(self, other: AssetCapacity) -> AssetCapacity
pub fn min(self, other: AssetCapacity) -> AssetCapacity
Sourcepub fn num_tranches(&self) -> u32
pub fn num_tranches(&self) -> u32
Returns the number of tranches in this AssetCapacity.
Sourcepub fn tranche_size(&self) -> Capacity
pub fn tranche_size(&self) -> Capacity
Returns the tranche size of this AssetCapacity.
Sourcefn check_same_tranche_size(&self, other: AssetCapacity)
fn check_same_tranche_size(&self, other: AssetCapacity)
Validates that two capacities have the same tranche size.
Sourcepub fn total_capacity(&self) -> Capacity
pub fn total_capacity(&self) -> Capacity
Returns the total capacity represented by this AssetCapacity.
Trait Implementations§
Source§impl Add for AssetCapacity
impl Add for AssetCapacity
Source§type Output = AssetCapacity
type Output = AssetCapacity
The resulting type after applying the
+ operator.Source§fn add(self, rhs: AssetCapacity) -> Self
fn add(self, rhs: AssetCapacity) -> Self
Performs the
+ operation. Read moreSource§impl Clone for AssetCapacity
impl Clone for AssetCapacity
Source§fn clone(&self) -> AssetCapacity
fn clone(&self) -> AssetCapacity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AssetCapacity
Source§impl Debug for AssetCapacity
impl Debug for AssetCapacity
Source§impl PartialEq for AssetCapacity
impl PartialEq for AssetCapacity
Source§impl PartialOrd for AssetCapacity
impl PartialOrd for AssetCapacity
impl StructuralPartialEq for AssetCapacity
Source§impl Sub for AssetCapacity
impl Sub for AssetCapacity
Source§type Output = AssetCapacity
type Output = AssetCapacity
The resulting type after applying the
- operator.Source§fn sub(self, rhs: AssetCapacity) -> Self
fn sub(self, rhs: AssetCapacity) -> Self
Performs the
- operation. Read moreAuto Trait Implementations§
impl Freeze for AssetCapacity
impl RefUnwindSafe for AssetCapacity
impl Send for AssetCapacity
impl Sync for AssetCapacity
impl Unpin for AssetCapacity
impl UnsafeUnpin for AssetCapacity
impl UnwindSafe for AssetCapacity
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