pub struct Quote { /* private fields */ }Expand description
Result of a swap quote calculation.
Contains the expected output amount, gas cost, and optionally the new pool state if the quote was requested with state modification enabled.
Implementations§
Source§impl Quote
impl Quote
Sourcepub fn new(
amount_out: BigUint,
gas: BigUint,
new_state: Option<Arc<dyn SwapQuoter>>,
) -> Self
pub fn new( amount_out: BigUint, gas: BigUint, new_state: Option<Arc<dyn SwapQuoter>>, ) -> Self
Creates a new quote result.
§Arguments
amount_out- The amount of output tokens that would be receivedgas- The estimated gas cost for executing this swap, excluding token transfers costnew_state- The new pool state after the swap (if state modification was requested)
Sourcepub fn amount_out(&self) -> &BigUint
pub fn amount_out(&self) -> &BigUint
Returns the amount of output tokens.
Sourcepub fn gas(&self) -> &BigUint
pub fn gas(&self) -> &BigUint
Returns the estimated swap gas cost excluding including token transfer cost.
Sourcepub fn new_state(&self) -> Option<Arc<dyn SwapQuoter>>
pub fn new_state(&self) -> Option<Arc<dyn SwapQuoter>>
Returns the new pool state after the swap, if available.
Auto Trait Implementations§
impl Freeze for Quote
impl !RefUnwindSafe for Quote
impl Send for Quote
impl Sync for Quote
impl Unpin for Quote
impl UnsafeUnpin for Quote
impl !UnwindSafe for Quote
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> 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 more