Struct serenity::cache::Settings [−][src]
pub struct Settings { pub max_messages: usize, // some fields omitted }
Settings for the cache.
Examples
Create new settings, specifying the maximum number of messages:
use serenity::cache::Settings as CacheSettings; let mut settings = CacheSettings::new(); settings.max_messages(10);
Fields
max_messages: usize
The maximum number of messages to store in a channel's message cache.
Defaults to 0.
Methods
impl Settings
[src]
impl Settings
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates new settings to be used with a cache.
ⓘImportant traits for &'a mut Rpub fn max_messages(&mut self, max: usize) -> &mut Self
[src]
ⓘImportant traits for &'a mut R
pub fn max_messages(&mut self, max: usize) -> &mut Self
Sets the maximum number of messages to cache in a channel.
Refer to max_messages
for more information.
Examples
Set the maximum number of messages to cache:
use serenity::cache::Settings; let mut settings = Settings::new(); settings.max_messages(10);
Trait Implementations
impl Clone for Settings
[src]
impl Clone for Settings
fn clone(&self) -> Settings
[src]
fn clone(&self) -> Settings
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Settings
[src]
impl Debug for Settings
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Settings
[src]
impl Default for Settings