pub enum PriceQuality {
Fast,
Optimal,
Verified,
}Expand description
Quote price-quality hint passed to the orderbook.
Controls the trade-off between response speed and price accuracy when
requesting a quote via POST /api/v1/quote.
§Example
use cow_types::PriceQuality;
let quality = PriceQuality::Optimal;
assert_eq!(quality.as_str(), "optimal");
assert!(quality.is_optimal());Variants§
Fast
Fast estimate — may be slightly stale.
Optimal
Optimal price — runs the full solver pipeline.
Verified
Like optimal but includes on-chain simulation to verify executability.
Implementations§
Source§impl PriceQuality
impl PriceQuality
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Returns the lowercase string used by the CoW Protocol API.
§Returns
"fast", "optimal", or "verified".
Sourcepub const fn is_fast(self) -> bool
pub const fn is_fast(self) -> bool
Returns true if the fast (potentially stale) price quality is
selected.
Sourcepub const fn is_optimal(self) -> bool
pub const fn is_optimal(self) -> bool
Returns true if the optimal (full solver pipeline) price quality
is selected. This is the default.
Sourcepub const fn is_verified(self) -> bool
pub const fn is_verified(self) -> bool
Returns true if the verified (on-chain simulation) price quality
is selected.
Trait Implementations§
Source§impl Clone for PriceQuality
impl Clone for PriceQuality
Source§fn clone(&self) -> PriceQuality
fn clone(&self) -> PriceQuality
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 PriceQuality
impl Debug for PriceQuality
Source§impl Default for PriceQuality
impl Default for PriceQuality
Source§fn default() -> PriceQuality
fn default() -> PriceQuality
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PriceQuality
impl<'de> Deserialize<'de> for PriceQuality
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 Display for PriceQuality
impl Display for PriceQuality
Source§impl PartialEq for PriceQuality
impl PartialEq for PriceQuality
Source§impl Serialize for PriceQuality
impl Serialize for PriceQuality
Source§impl TryFrom<&str> for PriceQuality
impl TryFrom<&str> for PriceQuality
impl Copy for PriceQuality
impl Eq for PriceQuality
impl StructuralPartialEq for PriceQuality
Auto Trait Implementations§
impl Freeze for PriceQuality
impl RefUnwindSafe for PriceQuality
impl Send for PriceQuality
impl Sync for PriceQuality
impl Unpin for PriceQuality
impl UnsafeUnpin for PriceQuality
impl UnwindSafe for PriceQuality
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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.