#[repr(C)]pub struct WithTsOut<T: HasRType> {
pub rec: T,
pub ts_out: u64,
}Expand description
Wrapper object for records that include the live gateway send timestamp (ts_out).
Fields§
§rec: TThe inner record.
ts_out: u64The live gateway send timestamp expressed as the number of nanoseconds since the UNIX epoch.
See ts_out.
Implementations§
Source§impl<T: HasRType> WithTsOut<T>
impl<T: HasRType> WithTsOut<T>
Sourcepub fn new(rec: T, ts_out: u64) -> Self
pub fn new(rec: T, ts_out: u64) -> Self
Creates a new record with ts_out. Updates the length property in
RecordHeader to ensure the additional field is accounted for.
Sourcepub fn ts_out(&self) -> OffsetDateTime
pub fn ts_out(&self) -> OffsetDateTime
Parses the raw live gateway send timestamp into a datetime.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for WithTsOut<T>where
T: Deserialize<'de> + HasRType,
impl<'de, T> Deserialize<'de> for WithTsOut<T>where
T: Deserialize<'de> + HasRType,
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
Source§impl<'py, R> IntoPyObject<'py> for WithTsOut<R>where
R: HasRType + IntoPyObject<'py>,
Available on crate feature python only.WithTsOut adds a ts_out field to the main record when converted to Python.
impl<'py, R> IntoPyObject<'py> for WithTsOut<R>where
R: HasRType + IntoPyObject<'py>,
Available on crate feature
python only.WithTsOut adds a ts_out field to the main record when converted to Python.
Source§impl<T: HasRType> Record for WithTsOut<T>
impl<T: HasRType> Record for WithTsOut<T>
Source§fn header(&self) -> &RecordHeader
fn header(&self) -> &RecordHeader
Returns a reference to the
RecordHeader that comes at the beginning of all
record types.Source§fn raw_index_ts(&self) -> u64
fn raw_index_ts(&self) -> u64
Returns the raw primary timestamp for the record. Read more
Source§fn record_size(&self) -> usize
fn record_size(&self) -> usize
Returns the size of the record in bytes.
Source§fn rtype(&self) -> Result<RType>
fn rtype(&self) -> Result<RType>
Tries to convert the raw record type into an enum which is useful for exhaustive
pattern matching. Read more
Source§fn publisher(&self) -> Result<Publisher>
fn publisher(&self) -> Result<Publisher>
Tries to convert the raw
publisher_id into an enum which is useful for
exhaustive pattern matching. Read moreSource§fn index_ts(&self) -> Option<OffsetDateTime>
fn index_ts(&self) -> Option<OffsetDateTime>
Returns the primary timestamp for the record. Returns
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>
Returns the primary date for the record; the date component of the primary
timestamp (
index_ts()). Returns None if the primary timestamp contains the
sentinel value for a null timestamp.Source§impl<T: HasRType> RecordMut for WithTsOut<T>
impl<T: HasRType> RecordMut for WithTsOut<T>
Source§fn header_mut(&mut self) -> &mut RecordHeader
fn header_mut(&mut self) -> &mut RecordHeader
Returns a mutable reference to the
RecordHeader that comes at the beginning of
all record types.impl<T: Copy + HasRType> Copy for WithTsOut<T>
impl<T: Eq + HasRType> Eq for WithTsOut<T>
impl<T: HasRType> StructuralPartialEq for WithTsOut<T>
Auto Trait Implementations§
impl<T> Freeze for WithTsOut<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithTsOut<T>where
T: RefUnwindSafe,
impl<T> Send for WithTsOut<T>where
T: Send,
impl<T> Sync for WithTsOut<T>where
T: Sync,
impl<T> Unpin for WithTsOut<T>where
T: Unpin,
impl<T> UnwindSafe for WithTsOut<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
self into an owned Python object, dropping type information.