pub trait StatRec: HasRType {
const UNDEF_STAT_QUANTITY: i64;
// Required methods
fn stat_type(&self) -> Result<StatType>;
fn ts_recv(&self) -> Option<OffsetDateTime>;
fn ts_ref(&self) -> Option<OffsetDateTime>;
fn update_action(&self) -> Result<StatUpdateAction>;
fn price(&self) -> i64;
fn quantity(&self) -> i64;
}Expand description
A trait for compatibility between different versions of statistics records.
Required Associated Constants§
Sourceconst UNDEF_STAT_QUANTITY: i64
const UNDEF_STAT_QUANTITY: i64
The sentinel value for a null quantity.
Required Methods§
Sourcefn ts_recv(&self) -> Option<OffsetDateTime>
fn ts_recv(&self) -> Option<OffsetDateTime>
Parses the raw capture-server-received timestamp into a datetime. Returns None
if ts_recv contains the sentinel for a null timestamp.
Sourcefn ts_ref(&self) -> Option<OffsetDateTime>
fn ts_ref(&self) -> Option<OffsetDateTime>
Parses the raw reference timestamp of the statistic value into a datetime.
Returns None if ts_ref contains the sentinel for a null timestamp.
Sourcefn update_action(&self) -> Result<StatUpdateAction>
fn update_action(&self) -> Result<StatUpdateAction>
Tries to convert the raw update_action to an enum.
§Errors
This function returns an error if the update_action field does not
contain a valid StatUpdateAction.
Sourcefn price(&self) -> i64
fn price(&self) -> i64
The value for price statistics expressed as a signed integer where every 1 unit
corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001. Will be
UNDEF_PRICE when unused.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.