pub trait UpdateAlgorithm {
// Required methods
fn update_device_properties<'life0, 'async_trait>(
&'life0 self,
properties: Properties,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sample<'life0, 'async_trait>(
&'life0 self,
urgency: Urgency,
) -> Pin<Box<dyn Future<Output = Result<TimeSample, SampleError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn next_possible_sample_time<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BootInstant> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
An |UpdateAlgorithm| trait produces time samples on demand.
Required Methods§
Sourcefn update_device_properties<'life0, 'async_trait>(
&'life0 self,
properties: Properties,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_device_properties<'life0, 'async_trait>(
&'life0 self,
properties: Properties,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the algorithm’s knowledge of device properties.
Sourcefn sample<'life0, 'async_trait>(
&'life0 self,
urgency: Urgency,
) -> Pin<Box<dyn Future<Output = Result<TimeSample, SampleError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sample<'life0, 'async_trait>(
&'life0 self,
urgency: Urgency,
) -> Pin<Box<dyn Future<Output = Result<TimeSample, SampleError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Produce a new time sample, taking into account Urgency
.
Sourcefn next_possible_sample_time<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BootInstant> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_possible_sample_time<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BootInstant> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the reference time at which the next sample may be produced.
A reference timeline is always given on the boot timeline, which means it could fall in a time when the device was suspended. We may want to wake the device to sample time, but also may decide not to, depending on power policy.