#[non_exhaustive]pub struct Settings {
pub max_messages: usize,
pub time_to_live: Duration,
pub cache_guilds: bool,
pub cache_channels: bool,
pub cache_users: bool,
}
Expand description
Settings for the cache.
§Examples
Create new settings, specifying the maximum number of messages:
use serenity::cache::Settings as CacheSettings;
let mut settings = CacheSettings::default();
settings.max_messages = 10;
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.max_messages: usize
The maximum number of messages to store in a channel’s message cache.
Defaults to 0.
time_to_live: Duration
How long temporarily-cached data should be stored before being thrown out.
Defaults to one hour.
cache_guilds: bool
Whether to cache guild data received from gateway.
Defaults to true.
cache_channels: bool
Whether to cache channel data received from gateway.
Defaults to true.
cache_users: bool
Whether to cache user data received from gateway.
Defaults to true.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
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