pub struct StreamsCache<F: StreamCreator, K: CacheKey> { /* private fields */ }Implementations§
Source§impl<F: StreamCreator, K: CacheKey> StreamsCache<F, K>
impl<F: StreamCreator, K: CacheKey> StreamsCache<F, K>
pub fn new( new_stream_creator: F, idle_entry_timeout: Duration, cleanup_interval: Duration, ) -> Self
pub fn with_default_cleanup_duration( new_stream_creator: F, idle_entry_timeout: Duration, ) -> Self
pub fn get( &self, key: K, now: Instant, ) -> Result<Arc<AsyncMutex<Stream>>, Box<dyn Error>>
Auto Trait Implementations§
impl<F, K> !Freeze for StreamsCache<F, K>
impl<F, K> RefUnwindSafe for StreamsCache<F, K>where
F: RefUnwindSafe,
impl<F, K> Send for StreamsCache<F, K>where
K: Send,
impl<F, K> Sync for StreamsCache<F, K>where
K: Send,
impl<F, K> Unpin for StreamsCache<F, K>
impl<F, K> UnwindSafe for StreamsCache<F, K>where
F: 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