pub struct InMemoryBagCollector<T> {
pub flush_period: Period,
pub buffer: Vec<T>,
}Expand description
In memory cache items
Fields§
§flush_period: PeriodCaller should flush cache every flush_period
buffer: Vec<T>Trait Implementations§
Source§impl<T> BagCollect<T, Vec<T>> for InMemoryBagCollector<T>
impl<T> BagCollect<T, Vec<T>> for InMemoryBagCollector<T>
Source§impl<T> Collect<T, Vec<T>, InMemoryBagCollectorConfig> for InMemoryBagCollector<T>
§Parameters
- T: input
- Vec
: output
impl<T> Collect<T, Vec<T>, InMemoryBagCollectorConfig> for InMemoryBagCollector<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 bag 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<InMemoryBagCollector<T>> for InMemoryBagCollectorConfig
impl<T> ConfigInto<InMemoryBagCollector<T>> for InMemoryBagCollectorConfig
Source§impl<T> FromConfig<InMemoryBagCollectorConfig> for InMemoryBagCollector<T>
impl<T> FromConfig<InMemoryBagCollectorConfig> for InMemoryBagCollector<T>
fn from_config<'async_trait>(
config: InMemoryBagCollectorConfig,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
Auto Trait Implementations§
impl<T> Freeze for InMemoryBagCollector<T>
impl<T> RefUnwindSafe for InMemoryBagCollector<T>where
T: RefUnwindSafe,
impl<T> Send for InMemoryBagCollector<T>where
T: Send,
impl<T> Sync for InMemoryBagCollector<T>where
T: Sync,
impl<T> Unpin for InMemoryBagCollector<T>where
T: Unpin,
impl<T> UnwindSafe for InMemoryBagCollector<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