pub enum PermissionsSource<'cache> {
Given(Permissions),
Cached {
cache: &'cache InMemoryCache,
current_user_id: Id<UserMarker>,
},
Request,
}Expand description
Specify how permissions are handled on WebhooksCache::update
Variants§
Given(Permissions)
Use the given permissions
Cached
Use the cache to get permissions
Refer to Twilight’s docs to make sure the passed cache is valid
Fields
§
cache: &'cache InMemoryCacheThe cache to get the permissions from
§
current_user_id: Id<UserMarker>The bot’s ID
Request
Understand the permissions from the error-response of the API request
You may want to use this if you aren’t already using InMemoryCache’s
permission feature, since the overhead of avoidable requests is usually
lower than caching the permissions
Trait Implementations§
Source§impl<'cache> Clone for PermissionsSource<'cache>
impl<'cache> Clone for PermissionsSource<'cache>
Source§fn clone(&self) -> PermissionsSource<'cache>
fn clone(&self) -> PermissionsSource<'cache>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'cache> Freeze for PermissionsSource<'cache>
impl<'cache> !RefUnwindSafe for PermissionsSource<'cache>
impl<'cache> Send for PermissionsSource<'cache>
impl<'cache> Sync for PermissionsSource<'cache>
impl<'cache> Unpin for PermissionsSource<'cache>
impl<'cache> !UnwindSafe for PermissionsSource<'cache>
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