pub struct FramePublisher<Key: Eq + Hash, Value> { /* private fields */ }
Expand description
Stores a key:value pair for the duration of this frame and the next.
Implementations§
Source§impl<Key: Eq + Hash, Value> FramePublisher<Key, Value>
impl<Key: Eq + Hash, Value> FramePublisher<Key, Value>
pub fn new() -> Self
Sourcepub fn set(&mut self, key: Key, value: Value)
pub fn set(&mut self, key: Key, value: Value)
Publish the value. It will be available for the duration of this and the next frame.
Sourcepub fn get(&self, key: &Key) -> Option<&Value>
pub fn get(&self, key: &Key) -> Option<&Value>
Retrieve a value if it was published this or the previous frame.
Sourcepub fn evict_cache(&mut self)
pub fn evict_cache(&mut self)
Must be called once per frame to clear the cache.
Trait Implementations§
Source§impl<Key, Value> CacheTrait for FramePublisher<Key, Value>
impl<Key, Value> CacheTrait for FramePublisher<Key, Value>
Auto Trait Implementations§
impl<Key, Value> Freeze for FramePublisher<Key, Value>
impl<Key, Value> RefUnwindSafe for FramePublisher<Key, Value>where
Key: RefUnwindSafe,
Value: RefUnwindSafe,
impl<Key, Value> Send for FramePublisher<Key, Value>
impl<Key, Value> Sync for FramePublisher<Key, Value>
impl<Key, Value> Unpin for FramePublisher<Key, Value>
impl<Key, Value> UnwindSafe for FramePublisher<Key, Value>where
Key: UnwindSafe,
Value: 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