pub struct InMemorySetCollector<T> {
pub flush_period: Period,
pub buffer: HashSet<T>,
}Expand description
In memory cache unique items
Fields§
§flush_period: PeriodCaller should flush cache every flush_period
buffer: HashSet<T>Trait Implementations§
Source§impl<T> Collect<T, Vec<T>, InMemorySetCollectorConfig> for InMemorySetCollector<T>
§Parameters
- T: input
- Vec
: output
impl<T> Collect<T, Vec<T>, InMemorySetCollectorConfig> for InMemorySetCollector<T>
§Parameters
- T: input
- Vec
: output
Source§fn get_flush_interval(&self) -> Interval
fn get_flush_interval(&self) -> Interval
Call by collector pipe to flush set in period
fn collect<'life0, 'async_trait>(
&'life0 mut self,
t: T,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<T>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl<T> ConfigInto<InMemorySetCollector<T>> for InMemorySetCollectorConfig
impl<T> ConfigInto<InMemorySetCollector<T>> for InMemorySetCollectorConfig
Source§impl<T> FromConfig<InMemorySetCollectorConfig> for InMemorySetCollector<T>
impl<T> FromConfig<InMemorySetCollectorConfig> for InMemorySetCollector<T>
fn from_config<'async_trait>(
config: InMemorySetCollectorConfig,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
Source§impl<T> SetCollect<T, HashSet<T>> for InMemorySetCollector<T>
impl<T> SetCollect<T, HashSet<T>> for InMemorySetCollector<T>
Auto Trait Implementations§
impl<T> Freeze for InMemorySetCollector<T>
impl<T> RefUnwindSafe for InMemorySetCollector<T>where
T: RefUnwindSafe,
impl<T> Send for InMemorySetCollector<T>where
T: Send,
impl<T> Sync for InMemorySetCollector<T>where
T: Sync,
impl<T> Unpin for InMemorySetCollector<T>where
T: Unpin,
impl<T> UnsafeUnpin for InMemorySetCollector<T>
impl<T> UnwindSafe for InMemorySetCollector<T>where
T: UnwindSafe,
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