pub struct NetworkFee {
pub amount_in_sell_currency: Uint<256, 4>,
pub amount_in_buy_currency: Uint<256, 4>,
}Expand description
Network fee expressed in both currencies.
Fields§
§amount_in_sell_currency: Uint<256, 4>Fee denominated in sell_token atoms.
amount_in_buy_currency: Uint<256, 4>Fee denominated in buy_token atoms (estimated).
Implementations§
Source§impl NetworkFee
impl NetworkFee
Sourcepub const fn new(
amount_in_sell_currency: Uint<256, 4>,
amount_in_buy_currency: Uint<256, 4>,
) -> NetworkFee
pub const fn new( amount_in_sell_currency: Uint<256, 4>, amount_in_buy_currency: Uint<256, 4>, ) -> NetworkFee
Construct a NetworkFee from sell-currency and buy-currency amounts.
§Arguments
amount_in_sell_currency— fee denominated in sell-token atoms.amount_in_buy_currency— fee denominated in buy-token atoms (estimated).
§Returns
A new NetworkFee instance.
Sourcepub fn is_zero(&self) -> bool
pub fn is_zero(&self) -> bool
Returns true if both fee components are zero.
§Returns
true when both amount_in_sell_currency and amount_in_buy_currency are U256::ZERO.
Sourcepub const fn total_atoms(&self) -> Uint<256, 4>
pub const fn total_atoms(&self) -> Uint<256, 4>
Total fee: sell_currency + buy_currency (saturating).
§Returns
The saturating sum of both fee components.
Trait Implementations§
Source§impl Clone for NetworkFee
impl Clone for NetworkFee
Source§fn clone(&self) -> NetworkFee
fn clone(&self) -> NetworkFee
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 NetworkFee
impl Debug for NetworkFee
Source§impl Default for NetworkFee
impl Default for NetworkFee
Source§fn default() -> NetworkFee
fn default() -> NetworkFee
Returns the “default value” for a type. Read more
Source§impl Display for NetworkFee
impl Display for NetworkFee
impl Copy for NetworkFee
Auto Trait Implementations§
impl Freeze for NetworkFee
impl RefUnwindSafe for NetworkFee
impl Send for NetworkFee
impl Sync for NetworkFee
impl Unpin for NetworkFee
impl UnsafeUnpin for NetworkFee
impl UnwindSafe for NetworkFee
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.