Skip to main content

ThreadCreate

Struct ThreadCreate 

Source
#[non_exhaustive]
pub struct ThreadCreate { pub thread: Channel, pub newly_created: bool, }
Expand description

The data of the Thread Create dispatch event: a thread was created, or the bot was added to a private thread (then the thread includes the bot’s ThreadMember).

Dereferences to the contained Channel.

discord.js counterpart: the ThreadCreate event (newlyCreated).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§thread: Channel

The thread.

§newly_created: bool

Whether the thread was just created (false when the bot was added to an existing thread).

Methods from Deref<Target = Channel>§

Source

pub fn id(&self) -> ChannelId

The channel’s ID.

discord.js counterpart: BaseChannel#id.

Source

pub fn kind(&self) -> ChannelType

The kind of channel.

discord.js counterpart: BaseChannel#type.

Source

pub fn guild_id(&self) -> Option<GuildId>

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.

Source

pub fn name(&self) -> Option<&str>

The channel’s name. None for DMs and unnamed group DMs.

discord.js counterpart: GuildChannel#name.

Source

pub fn parent_id(&self) -> Option<ChannelId>

The parent: the category of a guild channel, or the channel a thread was created in.

discord.js counterpart: GuildChannel#parentId.

Source

pub fn flags(&self) -> ChannelFlags

The channel’s flags.

discord.js counterpart: BaseChannel#flags.

Source

pub fn permission_overwrites(&self) -> &[Overwrite]

The permission overwrites of a guild channel; empty for DMs and threads.

discord.js counterpart: GuildChannel#permissionOverwrites.

Source

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 ThreadCreate

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ThreadCreate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for ThreadCreate

Source§

type Target = Channel

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Channel

Dereferences the value.
Source§

impl<'de> Deserialize<'de> for ThreadCreate

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ThreadCreate

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ThreadCreate

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ThreadCreate

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.