#[repr(C)]pub struct Bar {
pub bar_type: BarType,
pub open: Price,
pub high: Price,
pub low: Price,
pub close: Price,
pub volume: Quantity,
pub ts_event: UnixNanos,
pub ts_init: UnixNanos,
}Expand description
Represents an aggregated bar.
Fields§
§bar_type: BarTypeThe bar type for this bar.
open: PriceThe bars open price.
high: PriceThe bars high price.
low: PriceThe bars low price.
close: PriceThe bars close price.
volume: QuantityThe bars volume.
ts_event: UnixNanosUNIX timestamp (nanoseconds) when the data event occurred.
ts_init: UnixNanosUNIX timestamp (nanoseconds) when the instance was created.
Implementations§
Source§impl Bar
impl Bar
Sourcepub fn new_checked(
bar_type: BarType,
open: Price,
high: Price,
low: Price,
close: Price,
volume: Quantity,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Result<Self>
pub fn new_checked( bar_type: BarType, open: Price, high: Price, low: Price, close: Price, volume: Quantity, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Result<Self>
Sourcepub fn new(
bar_type: BarType,
open: Price,
high: Price,
low: Price,
close: Price,
volume: Quantity,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Self
pub fn new( bar_type: BarType, open: Price, high: Price, low: Price, close: Price, volume: Quantity, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Self
pub fn instrument_id(&self) -> InstrumentId
Sourcepub fn get_metadata(
bar_type: &BarType,
price_precision: u8,
size_precision: u8,
) -> HashMap<String, String>
pub fn get_metadata( bar_type: &BarType, price_precision: u8, size_precision: u8, ) -> HashMap<String, String>
Returns the metadata for the type, for use with serialization formats.
Sourcepub fn get_fields() -> IndexMap<String, String>
pub fn get_fields() -> IndexMap<String, String>
Returns the field map for the type, for use with Arrow schemas.
Trait Implementations§
Source§impl CatalogPathPrefix for Bar
impl CatalogPathPrefix for Bar
Source§fn path_prefix() -> &'static str
fn path_prefix() -> &'static str
Returns the path prefix (directory name) for this data type.
impl Copy for Bar
Source§impl<'de> Deserialize<'de> for Bar
impl<'de> Deserialize<'de> for Bar
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
impl Eq for Bar
Source§impl Serializable for Bar
impl Serializable for Bar
impl StructuralPartialEq for Bar
Auto Trait Implementations§
impl Freeze for Bar
impl RefUnwindSafe for Bar
impl Send for Bar
impl Sync for Bar
impl Unpin for Bar
impl UnsafeUnpin for Bar
impl UnwindSafe for Bar
Blanket Implementations§
impl<T> Allocation for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.