pub struct MarkPriceHistory {
pub instrument_name: String,
pub points: Vec<MarkPricePoint>,
}Expand description
Mark price history collection
Collection of mark price history points for an instrument,
returned by /public/get_mark_price_history.
Fields§
§instrument_name: StringInstrument name
points: Vec<MarkPricePoint>Collection of mark price points
Implementations§
Source§impl MarkPriceHistory
impl MarkPriceHistory
Sourcepub fn from_raw(instrument_name: String, data: Vec<(i64, f64)>) -> Self
pub fn from_raw(instrument_name: String, data: Vec<(i64, f64)>) -> Self
Create from raw API response data
Sourcepub fn add_point(&mut self, point: MarkPricePoint)
pub fn add_point(&mut self, point: MarkPricePoint)
Add a mark price point
Sourcepub fn latest(&self) -> Option<&MarkPricePoint>
pub fn latest(&self) -> Option<&MarkPricePoint>
Get the latest mark price point
Sourcepub fn earliest(&self) -> Option<&MarkPricePoint>
pub fn earliest(&self) -> Option<&MarkPricePoint>
Get the earliest mark price point
Trait Implementations§
Source§impl Clone for MarkPriceHistory
impl Clone for MarkPriceHistory
Source§fn clone(&self) -> MarkPriceHistory
fn clone(&self) -> MarkPriceHistory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MarkPriceHistory
impl Debug for MarkPriceHistory
Source§impl<'de> Deserialize<'de> for MarkPriceHistory
impl<'de> Deserialize<'de> for MarkPriceHistory
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 Display for MarkPriceHistory
impl Display for MarkPriceHistory
Source§impl PartialEq for MarkPriceHistory
impl PartialEq for MarkPriceHistory
Source§fn eq(&self, other: &MarkPriceHistory) -> bool
fn eq(&self, other: &MarkPriceHistory) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MarkPriceHistory
impl Serialize for MarkPriceHistory
impl StructuralPartialEq for MarkPriceHistory
Auto Trait Implementations§
impl Freeze for MarkPriceHistory
impl RefUnwindSafe for MarkPriceHistory
impl Send for MarkPriceHistory
impl Sync for MarkPriceHistory
impl Unpin for MarkPriceHistory
impl UnsafeUnpin for MarkPriceHistory
impl UnwindSafe for MarkPriceHistory
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