Skip to main content

Channel

Struct Channel 

Source
pub struct Channel {
Show 20 fields pub channel_id: ChannelId, pub kind: ChannelKind, pub name: String, pub topic: Option<String>, pub parent_id: Option<ChannelId>, pub position: u32, pub slowmode_s: u32, pub locked: bool, pub typing: TypingMode, pub retention: Retention, pub sync_with_parent: bool, pub history: HistoryAccess, pub history_rev: u64, pub distribution: DistributionMode, pub overrides: Vec<Override>, pub config: Map<String, Value>, pub head_seq: Option<u64>, pub user_limit: Option<u32>, pub voice_participants: Option<Vec<VoiceParticipant>>, pub participants: Vec<MemberId>,
}
Expand description

A channel or category as members see it (§8.2).

Fields§

§channel_id: ChannelId

Host-assigned id.

§kind: ChannelKind

The kind.

§name: String

1–100 scalars.

§topic: Option<String>

≤ 1 024 scalars.

§parent_id: Option<ChannelId>

The parent category; categories have none.

§position: u32

Position among siblings.

§slowmode_s: u32

0–21 600 s (§8.7).

§locked: bool

The locked flag (permissions §3.3, step 7d).

§typing: TypingMode

Who sees typing in the channel (§10.5); absent means named, and named is written absent.

§retention: Retention

Retention settings.

§sync_with_parent: bool

Whether the effective overrides are the parent’s (permissions §2.4).

§history: HistoryAccess

History access policy (ADR-0014).

§history_rev: u64

Incremented on each history change.

§distribution: DistributionMode

Host-chosen distribution mode; clients never send it.

§overrides: Vec<Override>

The channel’s own overrides.

§config: Map<String, Value>

SPEC: shown only as {} in §8.2 and never defined; kept as an opaque object.

§head_seq: Option<u64>

sync.snapshot only: the latest channel_seq (§10.1).

§user_limit: Option<u32>

Voice channels: the most participants, when limited (§8.12).

§voice_participants: Option<Vec<VoiceParticipant>>

sync.snapshot of a voice channel: who is in it now, without key packages (§8.12).

§participants: Vec<MemberId>

A dm channel’s two members, sorted by id bytes (§8.15); absent otherwise.

Trait Implementations§

Source§

impl Clone for Channel

Source§

fn clone(&self) -> Channel

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 Channel

Source§

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

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

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

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 PartialEq for Channel

Source§

fn eq(&self, other: &Channel) -> 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 Channel

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

impl StructuralPartialEq for Channel

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<T> Same for T

Source§

type Output = T

Should always be Self
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.