Skip to main content

Module cache

Module cache 

Source
Expand description

Cache module for guild channels.

This module provides caching functionality for guild channels using moka cache. It includes two caches:

The CacheArgs struct is used to retrieve channels from the cache or fetch them from the API if not found.

Structs§

CacheArgs
Arguments for cache operations.

Statics§

GUILD_CHANNEL_CACHE
Cache for individual guild channels, mapping channel IDs to their channel data.
GUILD_CHANNEL_LIST_CACHE
Cache for guild channel lists, mapping guild IDs to their channel lists.

Functions§

belongs_to_guild 🔒
Returns true when a channel resolved from cache is really in guild_id.
channel_cache 🔒
Builds a cache with the shared tuning for both channel caches: 500 entries, TTL 1 hour, TTI 1 hour.
invalidate_channel
Drops every cached view of channel_id.