#[non_exhaustive]pub struct WebhookChannel {
pub id: ChannelId,
pub name: String,
}
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.id: ChannelId
The unique Id of the channel.
name: String
The name of the channel.
Implementations§
Source§impl WebhookChannel
impl WebhookChannel
Sourcepub fn to_channel_cached(self, cache: &Cache) -> Option<GuildChannelRef<'_>>
👎Deprecated: Use Cache::guild and Guild::channels
pub fn to_channel_cached(self, cache: &Cache) -> Option<GuildChannelRef<'_>>
Attempts to find a GuildChannel
by its Id in the cache.
Sourcepub async fn to_channel(
self,
cache_http: impl CacheHttp,
) -> Result<GuildChannel>
pub async fn to_channel( self, cache_http: impl CacheHttp, ) -> Result<GuildChannel>
First attempts to retrieve the channel from the temp_cache
if enabled, otherwise performs
a HTTP request.
It is recommended to first check if the channel is accessible via Cache::guild
and
Guild::members
, although this requires a GuildId
.
§Errors
Returns Error::Http
if the channel retrieval request failed.
Trait Implementations§
Source§impl Clone for WebhookChannel
impl Clone for WebhookChannel
Source§fn clone(&self) -> WebhookChannel
fn clone(&self) -> WebhookChannel
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WebhookChannel
impl Debug for WebhookChannel
Source§impl<'de> Deserialize<'de> for WebhookChannel
impl<'de> Deserialize<'de> for WebhookChannel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 From<&WebhookChannel> for ChannelId
impl From<&WebhookChannel> for ChannelId
Source§fn from(webhook_channel: &WebhookChannel) -> ChannelId
fn from(webhook_channel: &WebhookChannel) -> ChannelId
Gets the Id of a webhook channel.
Source§impl From<WebhookChannel> for ChannelId
impl From<WebhookChannel> for ChannelId
Source§fn from(webhook_channel: WebhookChannel) -> ChannelId
fn from(webhook_channel: WebhookChannel) -> ChannelId
Gets the Id of a webhook channel.
Auto Trait Implementations§
impl Freeze for WebhookChannel
impl RefUnwindSafe for WebhookChannel
impl Send for WebhookChannel
impl Sync for WebhookChannel
impl Unpin for WebhookChannel
impl UnwindSafe for WebhookChannel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more