#[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: T
The inner record.
ts_out: u64
The live gateway send timestamp expressed as number of nanoseconds since the UNIX epoch.
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<R: HasRType + IntoPy<Py<PyAny>>> IntoPy<Py<PyAny>> for WithTsOut<R>
Available on crate feature python
only.
impl<R: HasRType + IntoPy<Py<PyAny>>> IntoPy<Py<PyAny>> for WithTsOut<R>
Available on crate feature
python
only.source§impl<T: PartialEq + HasRType> PartialEq for WithTsOut<T>
impl<T: PartialEq + HasRType> PartialEq for WithTsOut<T>
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