pub struct InMemoryCacheIter<'a>(/* private fields */);
Expand description
Interface to create iterators over various resources.
The created iterators will iterate over all entities of a resource.
The iteration order of all iterators are arbitrary.
Example:
use rive_cache_inmemory::InMemoryCache;
let cache = InMemoryCache::new();
// later in the code...
let count = cache
.iter()
.users()
.filter(|user| user.avatar.is_some())
.count();
println!("users with avatar: {count}");
Implementations§
Source§impl<'a> InMemoryCacheIter<'a>
impl<'a> InMemoryCacheIter<'a>
Sourcepub fn users(&'a self) -> ResourceIter<'_, String, User> ⓘ
pub fn users(&'a self) -> ResourceIter<'_, String, User> ⓘ
Create an iterator over the users in the cache.
Sourcepub fn serevrs(&'a self) -> ResourceIter<'_, String, Server> ⓘ
pub fn serevrs(&'a self) -> ResourceIter<'_, String, Server> ⓘ
Create an iterator over the servers in the cache.
Sourcepub fn channels(&'a self) -> ResourceIter<'_, String, Channel> ⓘ
pub fn channels(&'a self) -> ResourceIter<'_, String, Channel> ⓘ
Create an iterator over the channels in the cache.
Sourcepub fn messages(&'a self) -> ResourceIter<'_, String, Message> ⓘ
pub fn messages(&'a self) -> ResourceIter<'_, String, Message> ⓘ
Create an iterator over the messages in the cache.
Sourcepub fn emojis(&'a self) -> ResourceIter<'_, String, Emoji> ⓘ
pub fn emojis(&'a self) -> ResourceIter<'_, String, Emoji> ⓘ
Create an iterator over the emojis in the cache.
Sourcepub fn members(&'a self) -> ResourceIter<'_, MemberCompositeKey, Member> ⓘ
pub fn members(&'a self) -> ResourceIter<'_, MemberCompositeKey, Member> ⓘ
Create an iterator over the servers members in the cache.
Trait Implementations§
Source§impl<'a> Clone for InMemoryCacheIter<'a>
impl<'a> Clone for InMemoryCacheIter<'a>
Source§fn clone(&self) -> InMemoryCacheIter<'a>
fn clone(&self) -> InMemoryCacheIter<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for InMemoryCacheIter<'a>
impl<'a> !RefUnwindSafe for InMemoryCacheIter<'a>
impl<'a> Send for InMemoryCacheIter<'a>
impl<'a> Sync for InMemoryCacheIter<'a>
impl<'a> Unpin for InMemoryCacheIter<'a>
impl<'a> !UnwindSafe for InMemoryCacheIter<'a>
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