pub struct RpcPrice {
pub conf: u64,
pub expo: i32,
pub price: i64,
pub publish_time: i64,
}Expand description
A price with a degree of uncertainty at a certain time, represented as a price +- a confidence interval.
The confidence interval roughly corresponds to the standard error of a normal distribution.
Both the price and confidence are stored in a fixed-point numeric representation, x * 10^expo, where expo is the exponent. For example:
Fields§
§conf: u64The confidence interval associated with the price, stored as a string to avoid precision loss
expo: i32The exponent associated with both the price and confidence interval. Multiply those values
by 10^expo to get the real value.
price: i64The price itself, stored as a string to avoid precision loss
publish_time: i64When the price was published. The publish_time is a unix timestamp, i.e., the number of
seconds since the Unix epoch (00:00:00 UTC on 1 Jan 1970).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RpcPrice
impl<'de> Deserialize<'de> for RpcPrice
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>,
Auto Trait Implementations§
impl Freeze for RpcPrice
impl RefUnwindSafe for RpcPrice
impl Send for RpcPrice
impl Sync for RpcPrice
impl Unpin for RpcPrice
impl UnsafeUnpin for RpcPrice
impl UnwindSafe for RpcPrice
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more