pub struct Price { /* private fields */ }Expand description
Resolved protocol price units (protobuf price_ticks, fixed 1e6).
Fields are private so metadata cannot be changed independently of the
validated ticks. Use Price::symbol to inspect the immutable metadata.
Implementations§
Source§impl Price
impl Price
pub fn from_ticks(ticks: i64, symbol: Option<String>) -> Result<Self>
pub fn from_decimal_str(raw: &str, symbol: Option<String>) -> Result<Self>
pub fn from_decimal(raw: Decimal, symbol: Option<String>) -> Result<Self>
pub fn as_ticks(&self) -> i64
pub fn symbol(&self) -> Option<&str>
pub fn as_decimal(&self) -> Decimal
pub fn format(&self) -> String
pub fn compatible_with(&self, symbol: Option<&str>) -> Result<()>
Trait Implementations§
impl Eq for Price
impl StructuralPartialEq for Price
Auto Trait Implementations§
impl Freeze for Price
impl RefUnwindSafe for Price
impl Send for Price
impl Sync for Price
impl Unpin for Price
impl UnsafeUnpin for Price
impl UnwindSafe for Price
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.