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 generate_updates<'life0, 'async_trait>(
&'life0 self,
sink: Sender<Update>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
An |UpdateAlgorithm| asynchronously produces Updates.
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 generate_updates<'life0, 'async_trait>(
&'life0 self,
sink: Sender<Update>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_updates<'life0, 'async_trait>(
&'life0 self,
sink: Sender<Update>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate updates asynchronously and push them to |sink|. This method may run indefinitely. This method may generate duplicate updates.