pub trait Record {
// Required method
fn header(&self) -> &RecordHeader;
// Provided methods
fn record_size(&self) -> usize { ... }
fn rtype(&self) -> Result<RType> { ... }
fn publisher(&self) -> Result<Publisher> { ... }
fn raw_index_ts(&self) -> u64 { ... }
fn index_ts(&self) -> Option<OffsetDateTime> { ... }
fn index_date(&self) -> Option<Date> { ... }
}
Expand description
Used for polymorphism around types all beginning with a RecordHeader
where
rtype
is the discriminant used for indicating the type of record.
Required Methods§
sourcefn header(&self) -> &RecordHeader
fn header(&self) -> &RecordHeader
Returns a reference to the RecordHeader
that comes at the beginning of all
record types.
Provided Methods§
sourcefn record_size(&self) -> usize
fn record_size(&self) -> usize
Returns the size of the record in bytes.
sourcefn raw_index_ts(&self) -> u64
fn raw_index_ts(&self) -> u64
Returns the raw primary timestamp for the record.
This timestamp should be used for sorting records as well as indexing into any symbology data structure.
sourcefn 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.
This timestamp should be used for sorting records as well as indexing into any symbology data structure.
sourcefn 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.