[][src]Struct serenity::cache::Settings

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]

pub fn new() -> Self[src]

Creates new settings to be used with a cache.

pub fn max_messages(&mut self, max: usize) -> &mut Self[src]

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]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Settings[src]

impl Debug for Settings[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<T> DebugAny for T where
    T: Any + Debug
[src]

impl<T> CloneAny for T where
    T: Clone + Any
[src]

impl<T> UnsafeAny for T where
    T: Any