Trait Reload

Source
pub trait Reload<V, S = &'static str>
where V: Eq + PartialEq, S: Into<Cow<'static, str>> + Display,
{ type Source; // Required methods fn new<'life0, 'async_trait>( src: &'life0 Self::Source, ) -> Pin<Box<dyn Future<Output = Result<Self, ReloaderError<V, S>>> + Send + 'async_trait>> where Self: Sized + 'async_trait, 'life0: 'async_trait; fn reload<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<V>, ReloaderError<V, S>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; }
Expand description

Trait defining the responsibility of reloaders to periodically load the target value V from Source. Source could be a file, a KVS, whatever if you can implement Reload<V> with Reload<V>::Source.

Required Associated Types§

Required Methods§

Source

fn new<'life0, 'async_trait>( src: &'life0 Self::Source, ) -> Pin<Box<dyn Future<Output = Result<Self, ReloaderError<V, S>>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Source

fn reload<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<V>, ReloaderError<V, S>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§