pub struct PricePoint { /* private fields */ }Expand description
A price point with an optional label.
Implementations§
Source§impl PricePoint
impl PricePoint
Sourcepub const fn new(price: MarketPrice) -> PricePoint
pub const fn new(price: MarketPrice) -> PricePoint
Creates an unlabeled price point.
Sourcepub fn with_label(
self,
label: impl AsRef<str>,
) -> Result<PricePoint, PriceSeriesError>
pub fn with_label( self, label: impl AsRef<str>, ) -> Result<PricePoint, PriceSeriesError>
Attaches a non-empty point label.
§Errors
Returns PriceSeriesError::EmptyLabel when the trimmed label is empty.
Sourcepub const fn price(&self) -> MarketPrice
pub const fn price(&self) -> MarketPrice
Returns the price value.
Trait Implementations§
Source§impl Clone for PricePoint
impl Clone for PricePoint
Source§fn clone(&self) -> PricePoint
fn clone(&self) -> PricePoint
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 PricePoint
impl Debug for PricePoint
Source§impl PartialEq for PricePoint
impl PartialEq for PricePoint
impl StructuralPartialEq for PricePoint
Auto Trait Implementations§
impl Freeze for PricePoint
impl RefUnwindSafe for PricePoint
impl Send for PricePoint
impl Sync for PricePoint
impl Unpin for PricePoint
impl UnsafeUnpin for PricePoint
impl UnwindSafe for PricePoint
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