pub enum OrderStatus {
PresignaturePending,
Open,
Fulfilled,
Cancelled,
Expired,
}Expand description
Lifecycle state of an order on the orderbook.
Variants§
PresignaturePending
Awaiting an on-chain pre-signature.
Open
Awaiting a solver fill.
Fulfilled
Fully matched and settled.
Cancelled
Cancelled by the owner.
Expired
Past validTo without being filled.
Implementations§
Source§impl OrderStatus
impl OrderStatus
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Returns the camelCase string used by the CoW Protocol API.
Sourcepub const fn is_pending(self) -> bool
pub const fn is_pending(self) -> bool
Returns true if the order is pending or actively seeking a fill.
Both Self::PresignaturePending and Self::Open indicate the order
has not yet been settled, cancelled, or expired.
Sourcepub const fn is_fulfilled(self) -> bool
pub const fn is_fulfilled(self) -> bool
Returns true if the order was fully matched and settled on-chain.
Sourcepub const fn is_cancelled(self) -> bool
pub const fn is_cancelled(self) -> bool
Returns true if the order was cancelled by the owner.
Sourcepub const fn is_expired(self) -> bool
pub const fn is_expired(self) -> bool
Returns true if the order passed its validTo without being filled.
Sourcepub const fn is_terminal(self) -> bool
pub const fn is_terminal(self) -> bool
Returns true if the order is in a terminal state (no longer tradeable).
Terminal states are Self::Fulfilled, Self::Cancelled, and
Self::Expired.
Trait Implementations§
Source§impl Clone for OrderStatus
impl Clone for OrderStatus
Source§fn clone(&self) -> OrderStatus
fn clone(&self) -> OrderStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrderStatus
impl Debug for OrderStatus
Source§impl<'de> Deserialize<'de> for OrderStatus
impl<'de> Deserialize<'de> for OrderStatus
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OrderStatus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OrderStatus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for OrderStatus
impl Display for OrderStatus
Source§impl PartialEq for OrderStatus
impl PartialEq for OrderStatus
Source§impl Serialize for OrderStatus
impl Serialize for OrderStatus
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl TryFrom<&str> for OrderStatus
impl TryFrom<&str> for OrderStatus
Source§fn try_from(
s: &str,
) -> Result<OrderStatus, <OrderStatus as TryFrom<&str>>::Error>
fn try_from( s: &str, ) -> Result<OrderStatus, <OrderStatus as TryFrom<&str>>::Error>
Parse an OrderStatus from the CoW Protocol API string.
impl Copy for OrderStatus
impl Eq for OrderStatus
impl StructuralPartialEq for OrderStatus
Auto Trait Implementations§
impl Freeze for OrderStatus
impl RefUnwindSafe for OrderStatus
impl Send for OrderStatus
impl Sync for OrderStatus
impl Unpin for OrderStatus
impl UnsafeUnpin for OrderStatus
impl UnwindSafe for OrderStatus
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
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> 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>
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>
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.