pub enum OrderKind {
Sell,
Buy,
}Expand description
Whether to sell an exact input amount or buy an exact output amount.
Used in every order and quote request to specify the trade direction.
Serialises to "sell" or "buy" in JSON.
§Example
use cow_types::OrderKind;
let kind = OrderKind::Sell;
assert_eq!(kind.as_str(), "sell");
assert!(kind.is_sell());Variants§
Sell
Sell an exact input amount; receive at least buyAmount.
Buy
Buy an exact output amount; spend at most sellAmount.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OrderKind
impl<'de> Deserialize<'de> for OrderKind
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
impl Copy for OrderKind
impl Eq for OrderKind
impl StructuralPartialEq for OrderKind
Auto Trait Implementations§
impl Freeze for OrderKind
impl RefUnwindSafe for OrderKind
impl Send for OrderKind
impl Sync for OrderKind
impl Unpin for OrderKind
impl UnsafeUnpin for OrderKind
impl UnwindSafe for OrderKind
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.