#[non_exhaustive]pub struct ChannelUpdate {
pub old: Option<Arc<Channel>>,
pub new: ChannelUpdate,
}Expand description
The payload of Events::ChannelUpdate.
Dereferences to new, a ChannelUpdate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.old: Option<Arc<Channel>>What the cache held before the event, if it held it.
new: ChannelUpdateDiscord’s data for the event.
Methods from Deref<Target = Channel>§
Sourcepub fn id(&self) -> Id<ChannelMarker>
pub fn id(&self) -> Id<ChannelMarker>
The channel’s ID.
discord.js counterpart: BaseChannel#id.
Sourcepub fn kind(&self) -> ChannelType
pub fn kind(&self) -> ChannelType
The kind of channel.
discord.js counterpart: BaseChannel#type.
Sourcepub fn guild_id(&self) -> Option<Id<GuildMarker>>
pub fn guild_id(&self) -> Option<Id<GuildMarker>>
The guild the channel belongs to. None for DMs, and for guild channels inside
GUILD_CREATE (where Discord omits it).
discord.js counterpart: GuildChannel#guildId.
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
The channel’s name. None for DMs and unnamed group DMs.
discord.js counterpart: GuildChannel#name.
Sourcepub fn parent_id(&self) -> Option<Id<ChannelMarker>>
pub fn parent_id(&self) -> Option<Id<ChannelMarker>>
The parent: the category of a guild channel, or the channel a thread was created in.
discord.js counterpart: GuildChannel#parentId.
Sourcepub fn flags(&self) -> ChannelFlags
pub fn flags(&self) -> ChannelFlags
The channel’s flags.
discord.js counterpart: BaseChannel#flags.
Sourcepub fn permission_overwrites(&self) -> &[Overwrite]
pub fn permission_overwrites(&self) -> &[Overwrite]
The permission overwrites of a guild channel; empty for DMs and threads.
discord.js counterpart: GuildChannel#permissionOverwrites.
Sourcepub fn as_thread(&self) -> Option<&ThreadChannel>
pub fn as_thread(&self) -> Option<&ThreadChannel>
Returns the thread data if this channel is a thread.
discord.js counterpart: BaseChannel#isThread.
Trait Implementations§
Source§impl Clone for ChannelUpdate
impl Clone for ChannelUpdate
Source§impl Debug for ChannelUpdate
impl Debug for ChannelUpdate
Source§impl Deref for ChannelUpdate
impl Deref for ChannelUpdate
Source§type Target = ChannelUpdate
type Target = ChannelUpdate
Source§fn deref(&self) -> &ChannelUpdate
fn deref(&self) -> &ChannelUpdate
Source§impl PartialEq for ChannelUpdate
impl PartialEq for ChannelUpdate
impl StructuralPartialEq for ChannelUpdate
Auto Trait Implementations§
impl Freeze for ChannelUpdate
impl RefUnwindSafe for ChannelUpdate
impl Send for ChannelUpdate
impl Sync for ChannelUpdate
impl Unpin for ChannelUpdate
impl UnsafeUnpin for ChannelUpdate
impl UnwindSafe for ChannelUpdate
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
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> ⓘ
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> ⓘ
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