pub struct CacheArgs {
pub guild_id: GuildId,
pub channel_id: ChannelId,
}Expand description
Arguments for cache operations.
Fields§
§guild_id: GuildIdThe ID of the guild.
channel_id: ChannelIdThe ID of the channel.
Implementations§
Source§impl CacheArgs
impl CacheArgs
Sourcepub async fn get(&self, ctx: &Context) -> Result<GuildChannel>
pub async fn get(&self, ctx: &Context) -> Result<GuildChannel>
Retrieves a guild channel from cache or fetches it from the API.
The lookup order is:
- Individual channel cache
- Guild channel list cache
- Discord API (with cache update)
Sourceasync fn get_channel_list_from_api(
&self,
ctx: &Context,
) -> Result<HashMap<ChannelId, GuildChannel>>
async fn get_channel_list_from_api( &self, ctx: &Context, ) -> Result<HashMap<ChannelId, GuildChannel>>
Fetches the channel list from the Discord API and updates the cache.
Auto Trait Implementations§
impl Freeze for CacheArgs
impl RefUnwindSafe for CacheArgs
impl Send for CacheArgs
impl Sync for CacheArgs
impl Unpin for CacheArgs
impl UnwindSafe for CacheArgs
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