Struct dbn::symbol_map::PitSymbolMap
source · pub struct PitSymbolMap(/* private fields */);
Expand description
A point-in-time symbol map. Useful for working with live symbology or a historical request over a single day or other situations where the symbol mappings are known not to change.
Implementations§
source§impl PitSymbolMap
impl PitSymbolMap
sourcepub fn from_metadata(metadata: &Metadata, date: Date) -> Result<Self>
pub fn from_metadata(metadata: &Metadata, date: Date) -> Result<Self>
Creates a new PitSymbolMap
populated with the mappings from metadata
for
date
.
§Errors
This function returns an error if neither stype_in or stype_out are
SType::InstrumentId
. It will also return an error if it can’t
parse a symbol into u32
instrument ID or if date
is outside the query range
of the metadata.
sourcepub fn on_record(&mut self, record: RecordRef<'_>) -> Result<()>
pub fn on_record(&mut self, record: RecordRef<'_>) -> Result<()>
Handles updating the mappings (if required) for a generic record.
§Errors
This function returns an error when record
contains a SymbolMappingMsg
but
it contains invalid UTF-8.
sourcepub fn on_symbol_mapping<S: SymbolMappingRec>(
&mut self,
symbol_mapping: &S
) -> Result<()>
pub fn on_symbol_mapping<S: SymbolMappingRec>( &mut self, symbol_mapping: &S ) -> Result<()>
Handles updating the mappings for a symbol mapping record.
§Errors
This function returns an error when symbol_mapping
contains invalid UTF-8.
Trait Implementations§
source§impl Clone for PitSymbolMap
impl Clone for PitSymbolMap
source§fn clone(&self) -> PitSymbolMap
fn clone(&self) -> PitSymbolMap
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PitSymbolMap
impl Debug for PitSymbolMap
source§impl Default for PitSymbolMap
impl Default for PitSymbolMap
source§fn default() -> PitSymbolMap
fn default() -> PitSymbolMap
source§impl Index<u32> for PitSymbolMap
impl Index<u32> for PitSymbolMap
source§impl PartialEq for PitSymbolMap
impl PartialEq for PitSymbolMap
source§fn eq(&self, other: &PitSymbolMap) -> bool
fn eq(&self, other: &PitSymbolMap) -> bool
self
and other
values to be equal, and is used
by ==
.