pub struct Position<Rep, T> { /* private fields */ }๐Deprecated since 0.2.0
Expand description
Position.
Implementationsยง
Sourceยงimpl<Rep: Representation, T: PositionNum> Position<Rep, T>
impl<Rep: Representation, T: PositionNum> Position<Rep, T>
Sourcepub fn new(price: T, size: T, value: T) -> Option<Self>
๐Deprecated since 0.2.0
pub fn new(price: T, size: T, value: T) -> Option<Self>
Create a new Position.
Sourcepub fn from_naive<H: IntoNaivePosition<T>>(naive: H) -> Option<Self>
๐Deprecated since 0.2.0
pub fn from_naive<H: IntoNaivePosition<T>>(naive: H) -> Option<Self>
Create a new Position from IntoNaivePosition.
This method will convert the price and size of naive by Rep.
Sourcepub fn consumed(&self) -> Option<Self>
๐Deprecated since 0.2.0
pub fn consumed(&self) -> Option<Self>
Return a new position that consumes its value. (Equivalence I).
Return None if size is zero.
Sourcepub fn converted(&self, price: T) -> Self
๐Deprecated since 0.2.0
pub fn converted(&self, price: T) -> Self
Return a new position with the given price
but keep equivalent to the original position.
(Equivalence II)
Sourcepub fn convert(&mut self, price: T)
๐Deprecated since 0.2.0
pub fn convert(&mut self, price: T)
Convert the price to the given but keep equivalent to the original. (Equivalence II)
Sourcepub fn price(&self) -> Option<T>
๐Deprecated since 0.2.0
pub fn price(&self) -> Option<T>
Price in Rep representation.
Return None if naive price is zero when Rep is reversed.
Sourcepub fn naive_price(&self) -> &T
๐Deprecated since 0.2.0
pub fn naive_price(&self) -> &T
Naive price.
Sourcepub fn naive_size(&self) -> &T
๐Deprecated since 0.2.0
pub fn naive_size(&self) -> &T
Naive size.
Trait Implementationsยง
Sourceยงimpl<Rep: Representation, T: PositionNum> Add for Position<Rep, T>
impl<Rep: Representation, T: PositionNum> Add for Position<Rep, T>
Sourceยงimpl<Rep: Representation, T: PositionNum> Clone for Position<Rep, T>
impl<Rep: Representation, T: PositionNum> Clone for Position<Rep, T>
Sourceยงimpl<Rep: Representation, T: PositionNum + Debug> Debug for Position<Rep, T>
impl<Rep: Representation, T: PositionNum + Debug> Debug for Position<Rep, T>
Sourceยงimpl<Rep: Representation, T: PositionNum> Default for Position<Rep, T>
impl<Rep: Representation, T: PositionNum> Default for Position<Rep, T>
Sourceยงimpl<'de, Rep, T> Deserialize<'de> for Position<Rep, T>where
T: Deserialize<'de>,
impl<'de, Rep, T> Deserialize<'de> for Position<Rep, T>where
T: Deserialize<'de>,
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<Rep: Representation, T: PositionNum + Display> Display for Position<Rep, T>
impl<Rep: Representation, T: PositionNum + Display> Display for Position<Rep, T>
Sourceยงimpl<Rep: Representation, T: PositionNum> IntoNaivePosition<T> for Position<Rep, T>
impl<Rep: Representation, T: PositionNum> IntoNaivePosition<T> for Position<Rep, T>
Sourceยงfn into_naive(self) -> NaivePosition<T>
fn into_naive(self) -> NaivePosition<T>
Convert to a
NaivePosition.Sourceยงimpl<Rep: Representation, T: PositionNum> Neg for Position<Rep, T>
impl<Rep: Representation, T: PositionNum> Neg for Position<Rep, T>
Sourceยงimpl<Rep: Representation, T: PositionNum> PartialEq for Position<Rep, T>
impl<Rep: Representation, T: PositionNum> PartialEq for Position<Rep, T>
Sourceยงimpl<Rep: Representation, T: PositionNum> Sub for Position<Rep, T>
impl<Rep: Representation, T: PositionNum> Sub for Position<Rep, T>
impl<Rep: Representation, T: PositionNum + Copy> Copy for Position<Rep, T>
impl<Rep: Representation, T: PositionNum> Eq for Position<Rep, T>
Auto Trait Implementationsยง
impl<Rep, T> Freeze for Position<Rep, T>where
T: Freeze,
impl<Rep, T> RefUnwindSafe for Position<Rep, T>where
T: RefUnwindSafe,
Rep: RefUnwindSafe,
impl<Rep, T> Send for Position<Rep, T>
impl<Rep, T> Sync for Position<Rep, T>
impl<Rep, T> Unpin for Position<Rep, T>
impl<Rep, T> UnsafeUnpin for Position<Rep, T>where
T: UnsafeUnpin,
impl<Rep, T> UnwindSafe for Position<Rep, T>where
T: UnwindSafe,
Rep: UnwindSafe,
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<T, H> ToNaivePosition<T> for H
impl<T, H> ToNaivePosition<T> for H
Sourceยงfn to_naive(&self) -> NaivePosition<T>
fn to_naive(&self) -> NaivePosition<T>
Convert to a
NaivePosition.