Struct wicrs_server::hub::PermissionGroup [−][src]
Represents a set of permissions that can be easily given to any hub member.
Fields
id: ID
ID of the group.
name: String
Name of the group.
members: Vec<ID>
Array of the IDs of hub members who are members of the group.
hub_permissions: HubPermissions
Hub permission settings that the group has.
channel_permissions: HashMap<ID, ChannelPermissions>
Mapping of channel permission settings the group has to the channel they apply to.
created: u128
Time in milliseconds since Unix Epoch that the group was created.
Implementations
impl PermissionGroup
[src]
pub fn new(name: String, id: ID) -> Self
[src]
Creates a new permission group given a name and an ID.
pub fn add_member(&mut self, user: &mut HubMember)
[src]
Adds a hub member to the group, maps to HubMember::join_group
.
pub fn remove_member(&mut self, user: &mut HubMember)
[src]
Removes a hub member from the group, maps to HubMember::leave_group
.
pub fn set_permission(
&mut self,
permission: HubPermission,
value: PermissionSetting
)
[src]
&mut self,
permission: HubPermission,
value: PermissionSetting
)
Changes the setting of a hub permission for the group.
pub fn set_channel_permission(
&mut self,
channel_id: ID,
permission: ChannelPermission,
value: PermissionSetting
)
[src]
&mut self,
channel_id: ID,
permission: ChannelPermission,
value: PermissionSetting
)
Changes the setting of a channel permission for a specific channel for the group.
pub fn has_all_permissions(&self) -> bool
[src]
Checks if the group has the All
permission.
pub fn has_permission(&self, permission: &HubPermission) -> bool
[src]
Checks if the group has a permission.
pub fn has_channel_permission(
&self,
channel_id: &ID,
permission: &ChannelPermission
) -> bool
[src]
&self,
channel_id: &ID,
permission: &ChannelPermission
) -> bool
Checks if the group has a permission in a specific channel.
Trait Implementations
impl Clone for PermissionGroup
[src]
fn clone(&self) -> PermissionGroup
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PermissionGroup
[src]
impl<'de> Deserialize<'de> for PermissionGroup
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<PermissionGroup> for PermissionGroup
[src]
fn eq(&self, other: &PermissionGroup) -> bool
[src]
fn ne(&self, other: &PermissionGroup) -> bool
[src]
impl Serialize for PermissionGroup
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for PermissionGroup
[src]
Auto Trait Implementations
impl RefUnwindSafe for PermissionGroup
impl Send for PermissionGroup
impl Sync for PermissionGroup
impl Unpin for PermissionGroup
impl UnwindSafe for PermissionGroup
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> From<T> for T
[src]
impl<T> Fruit for T where
T: Send + Downcast,
[src]
T: Send + Downcast,
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
type Err = Infallible
pub fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
[src]
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,