pub struct IndexPrice {
pub estimated_delivery_price: f64,
pub index_price: f64,
pub timestamp: i64,
pub index_name: Option<String>,
}Expand description
Index price information
Fields§
§estimated_delivery_price: f64Estimated delivery price
index_price: f64Current index price
timestamp: i64Timestamp (milliseconds since Unix epoch)
index_name: Option<String>Index name
Implementations§
Source§impl IndexPrice
impl IndexPrice
Sourcepub fn new(
estimated_delivery_price: f64,
index_price: f64,
timestamp: i64,
) -> IndexPrice
pub fn new( estimated_delivery_price: f64, index_price: f64, timestamp: i64, ) -> IndexPrice
Create new index price
Sourcepub fn with_name(self, name: String) -> IndexPrice
pub fn with_name(self, name: String) -> IndexPrice
Set index name
Sourcepub fn price_difference(&self) -> f64
pub fn price_difference(&self) -> f64
Get price difference
Sourcepub fn price_difference_percentage(&self) -> f64
pub fn price_difference_percentage(&self) -> f64
Get price difference percentage
Trait Implementations§
Source§impl Clone for IndexPrice
impl Clone for IndexPrice
Source§fn clone(&self) -> IndexPrice
fn clone(&self) -> IndexPrice
Returns a duplicate 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 moreSource§impl Debug for IndexPrice
impl Debug for IndexPrice
Source§impl<'de> Deserialize<'de> for IndexPrice
impl<'de> Deserialize<'de> for IndexPrice
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexPrice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexPrice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for IndexPrice
impl Display for IndexPrice
Source§impl PartialEq for IndexPrice
impl PartialEq for IndexPrice
Source§impl Serialize for IndexPrice
impl Serialize for IndexPrice
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,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for IndexPrice
Auto Trait Implementations§
impl Freeze for IndexPrice
impl RefUnwindSafe for IndexPrice
impl Send for IndexPrice
impl Sync for IndexPrice
impl Unpin for IndexPrice
impl UnwindSafe for IndexPrice
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