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§
Sourcefn id(&self) -> Id<GuildMarker>
fn id(&self) -> Id<GuildMarker>
ID of the guild.
Sourcefn owner_id(&self) -> Id<UserMarker>
Available on crate feature permission-calculator
only.
fn owner_id(&self) -> Id<UserMarker>
permission-calculator
only.ID of the guild’s owner.
Set the guild’s unavailable flag.
Sourcefn update_with_guild_update(&mut self, guild_update: &GuildUpdate)
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.
Sourcefn increase_member_count(&mut self, amount: u64)
fn increase_member_count(&mut self, amount: u64)
Increase the guild member count.
Sourcefn decrease_member_count(&mut self, amount: u64)
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.