#[repr(u8)]pub enum DirectionToNotional {
Long = 0,
Short = 1,
}
Expand description
Direction in terms of notional
Variants§
Implementations§
§impl DirectionToNotional
impl DirectionToNotional
pub fn into_base(&self, market_type: MarketType) -> DirectionToBase
pub fn into_base(&self, market_type: MarketType) -> DirectionToBase
Convert into the direction to base
pub fn sign(&self) -> Signed<Decimal256>
pub fn sign(&self) -> Signed<Decimal256>
Return positive 1 for long, negative 1 for short
Trait Implementations§
§impl Clone for DirectionToNotional
impl Clone for DirectionToNotional
§fn clone(&self) -> DirectionToNotional
fn clone(&self) -> DirectionToNotional
Returns a copy 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 more§impl Debug for DirectionToNotional
impl Debug for DirectionToNotional
§impl<'de> Deserialize<'de> for DirectionToNotional
impl<'de> Deserialize<'de> for DirectionToNotional
§fn deserialize<__D>(
__deserializer: __D
) -> Result<DirectionToNotional, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<DirectionToNotional, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<&str> for DirectionToNotional
impl From<&str> for DirectionToNotional
§fn from(s: &str) -> DirectionToNotional
fn from(s: &str) -> DirectionToNotional
Converts to this type from the input type.
§impl JsonSchema for DirectionToNotional
impl JsonSchema for DirectionToNotional
§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read more§impl KeyDeserialize for DirectionToNotional
impl KeyDeserialize for DirectionToNotional
type Output = u8
§const KEY_ELEMS: u16 = 1u16
const KEY_ELEMS: u16 = 1u16
The number of key elements is used for the deserialization of compound keys.
It should be equal to PrimaryKey::key().len()
fn from_vec( value: Vec<u8> ) -> Result<<DirectionToNotional as KeyDeserialize>::Output, StdError>
fn from_slice(value: &[u8]) -> Result<Self::Output, StdError>
§impl PartialEq for DirectionToNotional
impl PartialEq for DirectionToNotional
§fn eq(&self, other: &DirectionToNotional) -> bool
fn eq(&self, other: &DirectionToNotional) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl<'a> Prefixer<'a> for DirectionToNotional
impl<'a> Prefixer<'a> for DirectionToNotional
§impl<'a> PrimaryKey<'a> for DirectionToNotional
impl<'a> PrimaryKey<'a> for DirectionToNotional
§type Prefix = ()
type Prefix = ()
These associated types need to implement
Prefixer
, so that they can be useful arguments
for prefix()
, sub_prefix()
, and their key-deserializable variants.type SubPrefix = ()
§type Suffix = DirectionToNotional
type Suffix = DirectionToNotional
These associated types need to implement
KeyDeserialize
, so that they can be returned from
range_de()
and friends.type SuperSuffix = DirectionToNotional
fn joined_key(&self) -> Vec<u8>
fn joined_extra_key(&self, key: &[u8]) -> Vec<u8>
§impl Serialize for DirectionToNotional
impl Serialize for DirectionToNotional
§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,
Serialize this value into the given Serde serializer. Read more
impl Copy for DirectionToNotional
impl Eq for DirectionToNotional
impl StructuralEq for DirectionToNotional
impl StructuralPartialEq for DirectionToNotional
Auto Trait Implementations§
impl RefUnwindSafe for DirectionToNotional
impl Send for DirectionToNotional
impl Sync for DirectionToNotional
impl Unpin for DirectionToNotional
impl UnwindSafe for DirectionToNotional
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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
§impl<T> QueryResultExt for Twhere
T: Serialize,
impl<T> QueryResultExt for Twhere T: Serialize,
§fn query_result(&self) -> Result<Binary, Error>
fn query_result(&self) -> Result<Binary, Error>
Convert the value to its JSON representation