pub struct BanManager<'a, B: Backend> { /* private fields */ }Expand description
The bans of one guild. Returned by Context::bans.
The cache does not keep bans, so every fetch asks Discord and returns the
djs-model Ban.
discord.js counterpart: GuildBanManager (guild.bans).
Implementations§
Source§impl<'a, B: Backend> BanManager<'a, B>
impl<'a, B: Backend> BanManager<'a, B>
Sourcepub const fn guild_id(self) -> GuildId
pub const fn guild_id(self) -> GuildId
The guild these bans belong to.
discord.js counterpart: GuildBanManager#guild.
Sourcepub fn fetch(
self,
user_id: UserId,
) -> Fetch<Ban, impl Future<Output = Result<Ban, Error>> + Send + 'a>
pub fn fetch( self, user_id: UserId, ) -> Fetch<Ban, impl Future<Output = Result<Ban, Error>> + Send + 'a>
A user’s ban (Get Guild Ban).
discord.js counterpart: GuildBanManager#fetch(user).
§Errors
Returns the REST error if the request failed (Discord answers 404 when the user is not banned).
Sourcepub async fn list(
self,
query: &GetGuildBans,
) -> Result<Collection<UserId, Ban>, Error>
pub async fn list( self, query: &GetGuildBans, ) -> Result<Collection<UserId, Ban>, Error>
A page of bans, sorted by user ID (Get Guild Bans).
discord.js counterpart: GuildBanManager#fetch().
§Errors
Returns the REST error if the request failed (it needs BAN_MEMBERS).
Trait Implementations§
Source§impl<B: Backend> Clone for BanManager<'_, B>
impl<B: Backend> Clone for BanManager<'_, B>
impl<B: Backend> Copy for BanManager<'_, B>
Auto Trait Implementations§
impl<'a, B> !RefUnwindSafe for BanManager<'a, B>
impl<'a, B> !UnwindSafe for BanManager<'a, B>
impl<'a, B> Freeze for BanManager<'a, B>
impl<'a, B> Send for BanManager<'a, B>
impl<'a, B> Sync for BanManager<'a, B>
impl<'a, B> Unpin for BanManager<'a, B>
impl<'a, B> UnsafeUnpin for BanManager<'a, B>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more