pub struct ChannelCache { /* private fields */ }Expand description
Cache for channels (channel_id -> Channel)
Implementations§
Source§impl ChannelCache
impl ChannelCache
pub fn new(enabled: bool) -> Self
pub fn is_enabled(&self) -> bool
pub fn get(&self, channel_id: &str) -> Option<Channel>
pub fn insert(&self, channel: Channel)
pub fn remove(&self, channel_id: &str) -> Option<Channel>
pub fn count(&self) -> usize
pub fn all(&self) -> Vec<Channel>
pub fn clear(&self)
Sourcepub fn initialize_from_ready(&self, data: Value)
pub fn initialize_from_ready(&self, data: Value)
Initializes the channel cache with data from the READY event
Trait Implementations§
Source§impl Clone for ChannelCache
impl Clone for ChannelCache
Source§fn clone(&self) -> ChannelCache
fn clone(&self) -> ChannelCache
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 Freeze for ChannelCache
impl !RefUnwindSafe for ChannelCache
impl Send for ChannelCache
impl Sync for ChannelCache
impl Unpin for ChannelCache
impl UnsafeUnpin for ChannelCache
impl !UnwindSafe for ChannelCache
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