pub struct Channel {
pub id: usize,
pub community: usize,
pub owner: usize,
pub created: usize,
pub minimum_role_read: u32,
pub minimum_role_write: u32,
pub position: usize,
pub members: Vec<usize>,
pub title: String,
pub last_message: usize,
}Expand description
A channel is a more “chat-like” feed in communities.
Fields§
§id: usize§community: usize§owner: usize§created: usize§minimum_role_read: u32The minimum role (as bits) that can read this channel.
minimum_role_write: u32The minimum role (as bits) that can write to this channel.
position: usizeThe position of this channel in the UI.
Top (0) to bottom.
members: Vec<usize>The members of the chat (ids). Should be empty if community > 0.
The owner should not be a member of the channel since any member can update members.
title: StringThe title of the channel.
last_message: usizeThe timestamp of the last message in the channel.
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn new(
community: usize,
owner: usize,
position: usize,
title: String,
) -> Self
pub fn new( community: usize, owner: usize, position: usize, title: String, ) -> Self
Create a new Channel.
Sourcepub fn check_post(
&self,
uid: usize,
membership: Option<CommunityPermission>,
) -> bool
pub fn check_post( &self, uid: usize, membership: Option<CommunityPermission>, ) -> bool
Check if the given uid can post in the channel.
Sourcepub fn check_read(
&self,
uid: usize,
membership: Option<CommunityPermission>,
) -> bool
pub fn check_read( &self, uid: usize, membership: Option<CommunityPermission>, ) -> bool
Check if the given uid can post in the channel.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Channel
impl<'de> Deserialize<'de> for Channel
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
Auto Trait Implementations§
impl Freeze for Channel
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnwindSafe for Channel
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