Channel

Enum Channel 

Source
pub enum Channel {
    SavedMessages {
        id: String,
        user: String,
    },
    DirectMessage {
        id: String,
        active: bool,
        recipients: Vec<String>,
        last_message_id: Option<String>,
    },
    Group {
        id: String,
        name: String,
        owner: String,
        description: Option<String>,
        recipients: Vec<String>,
        icon: Option<Attachment>,
        last_message_id: Option<String>,
        permissions: Option<Permission>,
        nsfw: bool,
    },
    TextChannel {
        id: String,
        server: String,
        name: String,
        description: Option<String>,
        icon: Option<Attachment>,
        last_message_id: Option<String>,
        default_permissions: Option<OverrideField>,
        role_permissions: HashMap<String, OverrideField>,
        nsfw: bool,
    },
    VoiceChannel {
        id: String,
        server: String,
        name: String,
        description: Option<String>,
        icon: Option<Attachment>,
        default_permissions: Option<OverrideField>,
        role_permissions: HashMap<String, OverrideField>,
        nsfw: bool,
    },
}
Expand description

Representation of a channel on Revolt

Variants§

§

SavedMessages

Personal “Saved Notes” channel which allows users to save messages

Fields

§id: String

Unique Id

§user: String

Id of the user this channel belongs to

§

DirectMessage

Direct message channel between two users

Fields

§id: String

Unique Id

§active: bool

Whether this direct message channel is currently open on both sides

§recipients: Vec<String>

2-tuple of user ids participating in direct message

§last_message_id: Option<String>

Id of the last message sent in this channel

§

Group

Group channel between 1 or more participants

Fields

§id: String

Unique Id

§name: String

Display name of the channel

§owner: String

User id of the owner of the group

§description: Option<String>

Channel description

§recipients: Vec<String>

Array of user ids participating in channel

§icon: Option<Attachment>

Custom icon attachment

§last_message_id: Option<String>

Id of the last message sent in this channel

§permissions: Option<Permission>

Permissions assigned to members of this group (does not apply to the owner of the group)

§nsfw: bool

Whether this group is marked as not safe for work

§

TextChannel

Text channel belonging to a server

Fields

§id: String

Unique Id

§server: String

Id of the server this channel belongs to

§name: String

Display name of the channel

§description: Option<String>

Channel description

§icon: Option<Attachment>

Custom icon attachment

§last_message_id: Option<String>

Id of the last message sent in this channel

§default_permissions: Option<OverrideField>

Default permissions assigned to users in this channel

§role_permissions: HashMap<String, OverrideField>

Permissions assigned based on role to this channel

§nsfw: bool

Whether this channel is marked as not safe for work

§

VoiceChannel

Voice channel belonging to a server

Fields

§id: String

Unique Id

§server: String

Id of the server this channel belongs to

§name: String

Display name of the channel

§description: Option<String>

Channel description

§icon: Option<Attachment>

Custom icon attachment

§default_permissions: Option<OverrideField>

Default permissions assigned to users in this channel

§role_permissions: HashMap<String, OverrideField>

Permissions assigned based on role to this channel

§nsfw: bool

Whether this channel is marked as not safe for work

Trait Implementations§

Source§

impl Clone for Channel

Source§

fn clone(&self) -> Channel

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

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

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