pub struct TrialRecord {
pub v: u32,
pub started_at: DateTime<Utc>,
pub installation_id: String,
pub hardware_digest: String,
}Expand description
A started trial.
Fields§
§v: u32§started_at: DateTime<Utc>§installation_id: String§hardware_digest: StringHardwareProfile::digest at trial start (lets the issuer recognise a
trial restarted on the same hardware).
Implementations§
Source§impl TrialRecord
impl TrialRecord
Sourcepub fn start(
now: DateTime<Utc>,
installation_id: &str,
hardware: &HardwareProfile,
) -> Self
pub fn start( now: DateTime<Utc>, installation_id: &str, hardware: &HardwareProfile, ) -> Self
Start a trial now.
Sourcepub fn earliest(a: Option<Self>, b: Option<Self>) -> Option<Self>
pub fn earliest(a: Option<Self>, b: Option<Self>) -> Option<Self>
Merge two traces of the same trial (e.g. file and database): the earlier start wins, so deleting one trace never restarts the trial.
Sourcepub fn status(
&self,
policy: &TrialPolicy,
now: DateTime<Utc>,
clock: &ClockStatus,
) -> TrialStatus
pub fn status( &self, policy: &TrialPolicy, now: DateTime<Utc>, clock: &ClockStatus, ) -> TrialStatus
Status at now. A clock set back before the trial start, or behind the
clock mark, ends the trial — otherwise turning the clock back would extend it.
Trait Implementations§
Source§impl Clone for TrialRecord
impl Clone for TrialRecord
Source§fn clone(&self) -> TrialRecord
fn clone(&self) -> TrialRecord
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrialRecord
impl Debug for TrialRecord
Source§impl<'de> Deserialize<'de> for TrialRecord
impl<'de> Deserialize<'de> for TrialRecord
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 PartialEq for TrialRecord
impl PartialEq for TrialRecord
Source§impl Serialize for TrialRecord
impl Serialize for TrialRecord
impl Eq for TrialRecord
impl StructuralPartialEq for TrialRecord
Auto Trait Implementations§
impl Freeze for TrialRecord
impl RefUnwindSafe for TrialRecord
impl Send for TrialRecord
impl Sync for TrialRecord
impl Unpin for TrialRecord
impl UnwindSafe for TrialRecord
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