Channel

Struct Channel 

Source
pub struct Channel<'a> {
Show 35 fields pub id: Snowflake, pub channel_type: u8, pub guild_id: Option<Snowflake>, pub position: Option<i32>, pub permission_overwrites: Vec<PermissionOverwrite>, pub name: Option<TitanString<'a>>, pub topic: Option<TitanString<'a>>, pub nsfw: bool, pub last_message_id: Option<Snowflake>, pub bitrate: Option<u32>, pub user_limit: Option<u32>, pub rate_limit_per_user: Option<u32>, pub recipients: Vec<User<'a>>, pub icon: Option<TitanString<'a>>, pub owner_id: Option<Snowflake>, pub application_id: Option<Snowflake>, pub managed: bool, pub parent_id: Option<Snowflake>, pub last_pin_timestamp: Option<TitanString<'a>>, pub rtc_region: Option<TitanString<'a>>, pub video_quality_mode: Option<u8>, pub message_count: Option<u32>, pub member_count: Option<u32>, pub thread_metadata: Option<ThreadMetadata<'a>>, pub member: Option<ThreadMember<'a>>, pub default_auto_archive_duration: Option<u32>, pub permissions: Option<Permissions>, pub flags: Option<u64>, pub total_message_sent: Option<u32>, pub available_tags: Vec<ForumTag<'a>>, pub applied_tags: Vec<Snowflake>, pub default_reaction_emoji: Option<DefaultReaction<'a>>, pub default_thread_rate_limit_per_user: Option<u32>, pub default_sort_order: Option<u8>, pub default_forum_layout: Option<u8>,
}
Expand description

Discord Channel representation.

Fields§

§id: Snowflake

Channel ID.

§channel_type: u8

Channel type.

§guild_id: Option<Snowflake>

Guild ID (if in a guild).

§position: Option<i32>

Sorting position.

§permission_overwrites: Vec<PermissionOverwrite>

Permission overwrites.

§name: Option<TitanString<'a>>

Channel name (1-100 characters).

§topic: Option<TitanString<'a>>

Channel topic (0-4096 characters for forum, 0-1024 for others).

§nsfw: bool

Whether NSFW.

§last_message_id: Option<Snowflake>

ID of the last message sent.

§bitrate: Option<u32>

Bitrate (for voice).

§user_limit: Option<u32>

User limit (for voice).

§rate_limit_per_user: Option<u32>

Rate limit per user in seconds.

§recipients: Vec<User<'a>>

Recipients of the DM.

§icon: Option<TitanString<'a>>

Icon hash (for group DM).

§owner_id: Option<Snowflake>

ID of the DM creator.

§application_id: Option<Snowflake>

Application ID of the group DM creator if bot-created.

§managed: bool

Whether the channel is managed by an application.

§parent_id: Option<Snowflake>

Parent category ID.

§last_pin_timestamp: Option<TitanString<'a>>

Last pin timestamp.

§rtc_region: Option<TitanString<'a>>

Voice region ID.

§video_quality_mode: Option<u8>

Video quality mode.

§message_count: Option<u32>

Approximate message count (threads).

§member_count: Option<u32>

Approximate member count (threads).

§thread_metadata: Option<ThreadMetadata<'a>>

Thread metadata.

§member: Option<ThreadMember<'a>>

Thread member object for the current user.

§default_auto_archive_duration: Option<u32>

Default auto-archive duration.

§permissions: Option<Permissions>

Computed permissions for the user.

§flags: Option<u64>

Channel flags as a bitfield.

§total_message_sent: Option<u32>

Total messages ever sent (threads).

§available_tags: Vec<ForumTag<'a>>

Tags available in a forum channel.

§applied_tags: Vec<Snowflake>

IDs of tags applied to a forum thread.

§default_reaction_emoji: Option<DefaultReaction<'a>>

Default reaction emoji.

§default_thread_rate_limit_per_user: Option<u32>

Default slowmode for threads.

§default_sort_order: Option<u8>

Default sort order for forum posts.

§default_forum_layout: Option<u8>

Default forum layout.

Trait Implementations§

Source§

impl<'a> Clone for Channel<'a>

Source§

fn clone(&self) -> Channel<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Channel<'a>

Source§

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

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

impl<'de, 'a> Deserialize<'de> for Channel<'a>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

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

impl<'a> Mention for Channel<'a>

Source§

fn mention(&self) -> String

Returns the mention string for this item (e.g., <@123>).
Source§

impl<'a> Serialize for Channel<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Channel<'a>

§

impl<'a> RefUnwindSafe for Channel<'a>

§

impl<'a> Send for Channel<'a>

§

impl<'a> Sync for Channel<'a>

§

impl<'a> Unpin for Channel<'a>

§

impl<'a> UnwindSafe for Channel<'a>

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> 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<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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

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