pub struct DerivedPayloadCache { /* private fields */ }Implementations§
Source§impl DerivedPayloadCache
impl DerivedPayloadCache
pub fn new(capacity: usize) -> Self
Sourcepub fn get_or_insert<F>(
&self,
frame: &Arc<AccessUnit>,
build: F,
) -> Option<Arc<Bytes>>
pub fn get_or_insert<F>( &self, frame: &Arc<AccessUnit>, build: F, ) -> Option<Arc<Bytes>>
Payload derived from frame, building it on a miss.
The build runs while the cache is locked so concurrent subscribers of the same frame wait for the first result instead of each converting the same bytes (that would defeat the cache exactly at the moment all viewers receive the frame).
pub fn is_empty(&self) -> bool
pub fn clear(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DerivedPayloadCache
impl Forget for DerivedPayloadCache
impl Move for DerivedPayloadCache
impl RefUnwindSafe for DerivedPayloadCache
impl Send for DerivedPayloadCache
impl Sync for DerivedPayloadCache
impl Unpin for DerivedPayloadCache
impl UnsafeUnpin for DerivedPayloadCachewhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(Arc<AccessUnit>, Arc<Bytes>)>: UnsafeUnpin,
impl UnwindSafe for DerivedPayloadCache
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