#[repr(C)]pub struct RecordHeader {
pub rtype: u8,
pub publisher_id: u16,
pub instrument_id: u32,
pub ts_event: u64,
/* private fields */
}Expand description
Common data for all Databento records. Always found at the beginning of a record struct.
Fields§
§rtype: u8The record type; with 0xe0..0x0F specifying MBP levels size. Record types
implement the trait HasRType, and the has_rtype
function can be used to check if that type can be used to decode a message with
a given rtype. The set of possible values is defined in rtype.
publisher_id: u16The publisher ID assigned by Databento, which denotes the dataset and venue.
See Publishers.
instrument_id: u32The numeric instrument ID. See Instrument identifiers.
ts_event: u64The matching-engine-received timestamp expressed as the number of nanoseconds since the UNIX epoch.
Implementations§
Source§impl RecordHeader
impl RecordHeader
Source§impl RecordHeader
impl RecordHeader
Sourcepub const LENGTH_MULTIPLIER: usize = 4usize
pub const LENGTH_MULTIPLIER: usize = 4usize
The multiplier for converting the length field to the number of bytes.
Sourcepub const fn new<R: HasRType>(
rtype: u8,
publisher_id: u16,
instrument_id: u32,
ts_event: u64,
) -> Self
pub const fn new<R: HasRType>( rtype: u8, publisher_id: u16, instrument_id: u32, ts_event: u64, ) -> Self
Creates a new RecordHeader. R and rtype should be compatible.
Sourcepub const fn record_size(&self) -> usize
pub const fn record_size(&self) -> usize
Returns the size of the entire record in bytes. The size of a RecordHeader
is constant.
Sourcepub fn ts_event(&self) -> Option<OffsetDateTime>
pub fn ts_event(&self) -> Option<OffsetDateTime>
Parses the raw matching-engine-received timestamp into a datetime. Returns
None if ts_event contains the sentinel for a null timestamp.
Trait Implementations§
Source§impl Clone for RecordHeader
impl Clone for RecordHeader
Source§fn clone(&self) -> RecordHeader
fn clone(&self) -> RecordHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RecordHeader
impl Debug for RecordHeader
Source§impl<'de> Deserialize<'de> for RecordHeader
impl<'de> Deserialize<'de> for RecordHeader
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>,
Source§impl Hash for RecordHeader
impl Hash for RecordHeader
Source§impl<'py> IntoPyObject<'py> for RecordHeader
impl<'py> IntoPyObject<'py> for RecordHeader
Source§type Target = RecordHeader
type Target = RecordHeader
Source§type Output = Bound<'py, <RecordHeader as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <RecordHeader as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PartialEq for RecordHeader
impl PartialEq for RecordHeader
Source§impl PyClass for RecordHeader
impl PyClass for RecordHeader
Source§impl PyClassImpl for RecordHeader
impl PyClassImpl for RecordHeader
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
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§type ThreadChecker = SendablePyClass<RecordHeader>
type ThreadChecker = SendablePyClass<RecordHeader>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§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<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a RecordHeader
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a RecordHeader
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut RecordHeader
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut RecordHeader
Source§impl PyTypeInfo for RecordHeader
impl PyTypeInfo for RecordHeader
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Source§impl Serialize for RecordHeader
impl Serialize for RecordHeader
impl Copy for RecordHeader
impl DerefToPyAny for RecordHeader
impl Eq for RecordHeader
impl StructuralPartialEq for RecordHeader
Auto Trait Implementations§
impl Freeze for RecordHeader
impl RefUnwindSafe for RecordHeader
impl Send for RecordHeader
impl Sync for RecordHeader
impl Unpin for RecordHeader
impl UnwindSafe for RecordHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromPyObject<'_> for T
impl<T> FromPyObject<'_> for T
Source§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.