CacheableChannel

Trait CacheableChannel 

Source
pub trait CacheableChannel:
    From<Channel>
    + PartialEq<Channel>
    + PartialEq<Self>
    + Clone
    + Debug {
    // Required methods
    fn guild_id(&self) -> Option<Id<GuildMarker>>;
    fn kind(&self) -> ChannelType;
    fn parent_id(&self) -> Option<Id<ChannelMarker>>;
    fn id(&self) -> Id<ChannelMarker>;
    fn permission_overwrites(&self) -> Option<&[PermissionOverwrite]>;
    fn set_last_pin_timestamp(&mut self, timestamp: Option<Timestamp>);
}
Expand description

Trait for a generic cached representation of a Channel.

Required Methods§

Source

fn guild_id(&self) -> Option<Id<GuildMarker>>

ID of the guild this channel belongs to.

Source

fn kind(&self) -> ChannelType

Type of the channel.

Source

fn parent_id(&self) -> Option<Id<ChannelMarker>>

Available on crate feature permission-calculator only.

ID of the parent channel if this is a thread.

Source

fn id(&self) -> Id<ChannelMarker>

ID of the channel.

Source

fn permission_overwrites(&self) -> Option<&[PermissionOverwrite]>

Available on crate feature permission-calculator only.

Permission overwrites for the channel.

Source

fn set_last_pin_timestamp(&mut self, timestamp: Option<Timestamp>)

Set the last pin timestamp to a new timestamp.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CacheableChannel for Channel

Source§

fn guild_id(&self) -> Option<Id<GuildMarker>>

Source§

fn kind(&self) -> ChannelType

Source§

fn parent_id(&self) -> Option<Id<ChannelMarker>>

Available on crate feature permission-calculator only.
Source§

fn id(&self) -> Id<ChannelMarker>

Source§

fn permission_overwrites(&self) -> Option<&[PermissionOverwrite]>

Available on crate feature permission-calculator only.
Source§

fn set_last_pin_timestamp(&mut self, timestamp: Option<Timestamp>)

Implementors§