CacheableGuild

Trait CacheableGuild 

Source
pub trait CacheableGuild:
    From<Guild>
    + PartialEq<Guild>
    + PartialEq<Self>
    + Clone
    + Debug {
    // Required methods
    fn id(&self) -> Id<GuildMarker>;
    fn owner_id(&self) -> Id<UserMarker>;
    fn set_unavailable(&mut self, unavailable: Option<bool>);
    fn update_with_guild_update(&mut self, guild_update: &GuildUpdate);
    fn increase_member_count(&mut self, amount: u64);
    fn decrease_member_count(&mut self, amount: u64);
}
Expand description

Trait for a generic cached representation of a Guild.

Required Methods§

Source

fn id(&self) -> Id<GuildMarker>

ID of the guild.

Source

fn owner_id(&self) -> Id<UserMarker>

Available on crate feature permission-calculator only.

ID of the guild’s owner.

Source

fn set_unavailable(&mut self, unavailable: Option<bool>)

Set the guild’s unavailable flag.

Source

fn update_with_guild_update(&mut self, guild_update: &GuildUpdate)

Update the cached data with a GuildUpdate event. Fields containing other cached structures such as channels are cleared prior.

Source

fn increase_member_count(&mut self, amount: u64)

Increase the guild member count.

Source

fn decrease_member_count(&mut self, amount: u64)

Decrease the guild member count.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§