Struct dbn::record::SymbolMappingMsg
source · #[repr(C)]pub struct SymbolMappingMsg {
pub hd: RecordHeader,
pub stype_in: u8,
pub stype_in_symbol: [c_char; 71],
pub stype_out: u8,
pub stype_out_symbol: [c_char; 71],
pub start_ts: u64,
pub end_ts: u64,
}Expand description
A symbol mapping message which maps a symbol of one SType
to another.
Fields§
§hd: RecordHeaderThe common header.
stype_in: u8The input symbology type of stype_in_symbol.
stype_in_symbol: [c_char; 71]The input symbol.
stype_out: u8The output symbology type of stype_out_symbol.
stype_out_symbol: [c_char; 71]The output symbol.
start_ts: u64The start of the mapping interval expressed as the number of nanoseconds since the UNIX epoch.
end_ts: u64The end of the mapping interval expressed as the number of nanoseconds since the UNIX epoch.
Implementations§
source§impl SymbolMappingMsg
impl SymbolMappingMsg
sourcepub fn new(
instrument_id: u32,
ts_event: u64,
stype_in: SType,
stype_in_symbol: &str,
stype_out: SType,
stype_out_symbol: &str,
start_ts: u64,
end_ts: u64
) -> Result<Self>
pub fn new( instrument_id: u32, ts_event: u64, stype_in: SType, stype_in_symbol: &str, stype_out: SType, stype_out_symbol: &str, start_ts: u64, end_ts: u64 ) -> Result<Self>
Creates a new SymbolMappingMsgV2.
Errors
This function returns an error if stype_in_symbol or stype_out_symbol
contain more than maximum number of characters of 70.
sourcepub fn stype_in_symbol(&self) -> Result<&str>
pub fn stype_in_symbol(&self) -> Result<&str>
Returns the input symbol as a &str.
Errors
This function returns an error if stype_in_symbol contains invalid UTF-8.
sourcepub fn stype_out_symbol(&self) -> Result<&str>
pub fn stype_out_symbol(&self) -> Result<&str>
Returns the output symbol as a &str.
Errors
This function returns an error if stype_out_symbol contains invalid UTF-8.
sourcepub fn start_ts(&self) -> Option<OffsetDateTime>
pub fn start_ts(&self) -> Option<OffsetDateTime>
Parses the raw start of the mapping interval into a datetime. Returns None if
start_ts contains the sentinel for a null timestamp.
sourcepub fn end_ts(&self) -> Option<OffsetDateTime>
pub fn end_ts(&self) -> Option<OffsetDateTime>
Parses the raw end of the mapping interval into a datetime. Returns None if
end_ts contains the sentinel for a null timestamp.
Trait Implementations§
source§impl AsRef<[u8]> for SymbolMappingMsg
impl AsRef<[u8]> for SymbolMappingMsg
source§impl Clone for SymbolMappingMsg
impl Clone for SymbolMappingMsg
source§fn clone(&self) -> SymbolMappingMsg
fn clone(&self) -> SymbolMappingMsg
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for SymbolMappingMsg
impl Debug for SymbolMappingMsg
source§impl Default for SymbolMappingMsg
impl Default for SymbolMappingMsg
source§impl<'a> From<&'a SymbolMappingMsg> for RecordRefEnum<'a>
impl<'a> From<&'a SymbolMappingMsg> for RecordRefEnum<'a>
source§fn from(rec: &'a SymbolMappingMsg) -> Self
fn from(rec: &'a SymbolMappingMsg) -> Self
source§impl From<&SymbolMappingMsgV1> for SymbolMappingMsg
impl From<&SymbolMappingMsgV1> for SymbolMappingMsg
source§fn from(old: &SymbolMappingMsgV1) -> Self
fn from(old: &SymbolMappingMsgV1) -> Self
source§impl From<SymbolMappingMsg> for RecordEnum
impl From<SymbolMappingMsg> for RecordEnum
source§fn from(rec: SymbolMappingMsg) -> Self
fn from(rec: SymbolMappingMsg) -> Self
source§impl HasRType for SymbolMappingMsg
impl HasRType for SymbolMappingMsg
source§impl PartialEq for SymbolMappingMsg
impl PartialEq for SymbolMappingMsg
source§fn eq(&self, other: &SymbolMappingMsg) -> bool
fn eq(&self, other: &SymbolMappingMsg) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for SymbolMappingMsg
impl PartialOrd for SymbolMappingMsg
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl PyClass for SymbolMappingMsg
impl PyClass for SymbolMappingMsg
source§impl PyClassImpl for SymbolMappingMsg
impl PyClassImpl for SymbolMappingMsg
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type ThreadChecker = SendablePyClass<SymbolMappingMsg>
type ThreadChecker = SendablePyClass<SymbolMappingMsg>
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn dict_offset() -> Option<Py_ssize_t>
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn weaklist_offset() -> Option<isize>
source§impl PyClassNewTextSignature<SymbolMappingMsg> for PyClassImplCollector<SymbolMappingMsg>
Available on crate feature python only.
impl PyClassNewTextSignature<SymbolMappingMsg> for PyClassImplCollector<SymbolMappingMsg>
python only.fn new_text_signature(self) -> Option<&'static str>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a SymbolMappingMsg
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a SymbolMappingMsg
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut SymbolMappingMsg
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut SymbolMappingMsg
source§impl PyMethods<SymbolMappingMsg> for PyClassImplCollector<SymbolMappingMsg>
Available on crate feature python only.
impl PyMethods<SymbolMappingMsg> for PyClassImplCollector<SymbolMappingMsg>
python only.fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for SymbolMappingMsg
impl PyTypeInfo for SymbolMappingMsg
§type AsRefTarget = PyCell<SymbolMappingMsg>
type AsRefTarget = PyCell<SymbolMappingMsg>
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
object is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
object is an instance of this type.source§impl Record for SymbolMappingMsg
impl Record for SymbolMappingMsg
source§fn header(&self) -> &RecordHeader
fn header(&self) -> &RecordHeader
RecordHeader that comes at the beginning of all
record types.source§fn record_size(&self) -> usize
fn record_size(&self) -> usize
source§fn rtype(&self) -> Result<RType>
fn rtype(&self) -> Result<RType>
source§fn publisher(&self) -> Result<Publisher>
fn publisher(&self) -> Result<Publisher>
publisher_id into an enum which is useful for
exhaustive pattern matching. Read moresource§fn raw_index_ts(&self) -> u64
fn raw_index_ts(&self) -> u64
source§fn index_ts(&self) -> Option<OffsetDateTime>
fn index_ts(&self) -> Option<OffsetDateTime>
None if the primary
timestamp contains the sentinel value for a null timestamp. Read moresource§fn index_date(&self) -> Option<Date>
fn index_date(&self) -> Option<Date>
index_ts()). Returns None if the primary timestamp contains the
sentinel value for a null timestamp.source§impl RecordMut for SymbolMappingMsg
impl RecordMut for SymbolMappingMsg
source§fn header_mut(&mut self) -> &mut RecordHeader
fn header_mut(&mut self) -> &mut RecordHeader
RecordHeader that comes at the beginning of
all record types.source§impl SymbolMappingRec for SymbolMappingMsgV2
impl SymbolMappingRec for SymbolMappingMsgV2
source§fn start_ts(&self) -> Option<OffsetDateTime>
fn start_ts(&self) -> Option<OffsetDateTime>
None if
start_ts contains the sentinel for a null timestamp.source§fn end_ts(&self) -> Option<OffsetDateTime>
fn end_ts(&self) -> Option<OffsetDateTime>
None if
end_ts contains the sentinel for a null timestamp.