Struct twilight_http::request::channel::UpdateChannelPermission
source · [−]pub struct UpdateChannelPermission<'a> { /* private fields */ }
Expand description
Update the permissions for a role or a user in a channel.
Examples:
Create permission overrides for a role to view the channel, but not send messages:
use twilight_model::{
guild::Permissions,
http::permission_overwrite::{PermissionOverwrite, PermissionOverwriteType},
id::Id,
};
let channel_id = Id::new(123);
let permission_overwrite = PermissionOverwrite {
allow: Some(Permissions::VIEW_CHANNEL),
deny: Some(Permissions::SEND_MESSAGES),
id: Id::new(432),
kind: PermissionOverwriteType::Role,
};
client
.update_channel_permission(channel_id, &permission_overwrite)
.exec()
.await?;
Implementations
sourceimpl<'a> UpdateChannelPermission<'a>
impl<'a> UpdateChannelPermission<'a>
sourcepub fn exec(self) -> ResponseFuture<EmptyBody>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
pub fn exec(self) -> ResponseFuture<EmptyBody>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
Execute the request, returning a future resolving to a Response
.
Trait Implementations
sourceimpl<'a> AuditLogReason<'a> for UpdateChannelPermission<'a>
impl<'a> AuditLogReason<'a> for UpdateChannelPermission<'a>
sourceimpl TryIntoRequest for UpdateChannelPermission<'_>
impl TryIntoRequest for UpdateChannelPermission<'_>
Auto Trait Implementations
impl<'a> !RefUnwindSafe for UpdateChannelPermission<'a>
impl<'a> Send for UpdateChannelPermission<'a>
impl<'a> Sync for UpdateChannelPermission<'a>
impl<'a> Unpin for UpdateChannelPermission<'a>
impl<'a> !UnwindSafe for UpdateChannelPermission<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more