Skip to main content

twilight_model/gateway/payload/incoming/
channel_update.rs

1use crate::channel::Channel;
2use serde::{Deserialize, Serialize};
3use std::ops::{Deref, DerefMut};
4
5/// A channel has been updated.
6///
7/// # Channel obfuscation
8///
9/// A guild channel which a user does not have access to may be obfuscated. Once
10/// the current user has access to a guild channel the previously obfuscated
11/// fields will have their true values revealed. Refer to the documentation for
12/// [`Channel`] for more information on channel obfuscation.
13#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
14pub struct ChannelUpdate(pub Channel);
15
16impl Deref for ChannelUpdate {
17    type Target = Channel;
18
19    fn deref(&self) -> &Self::Target {
20        &self.0
21    }
22}
23
24impl DerefMut for ChannelUpdate {
25    fn deref_mut(&mut self) -> &mut Self::Target {
26        &mut self.0
27    }
28}