Struct wicrs_server::hub::HubMember[][src]

pub struct HubMember {
    pub user: ID,
    pub joined: DateTime<Utc>,
    pub hub: ID,
    pub nickname: String,
    pub groups: Vec<ID>,
    pub hub_permissions: HubPermissions,
    pub channel_permissions: HashMap<ID, ChannelPermissions>,
}

Represents a member of a hub that maps to a user.

Fields

user: ID

ID of the user that the hub member represents.

joined: DateTime<Utc>

Time in milliseconds since Unix Epoch that the user became a member of the hub.

hub: ID

ID of the hub that this hub member is in.

nickname: String

Name used by the hub member.

groups: Vec<ID>

Groups that the hub member is part of.

hub_permissions: HubPermissions

Hub permission settings that the hub member has.

channel_permissions: HashMap<ID, ChannelPermissions>

Mapping of channel permission settings the hub member has to the channel they apply to.

Implementations

impl HubMember[src]

pub fn new(user: &User, hub: ID) -> Self[src]

Creates a new hub member based on a user and the ID of the hub they are part of.

pub fn set_nickname(&mut self, nickname: String) -> Result[src]

Changes the nickname of the hub member or returns an error if check_name_validity fails.

pub fn join_group(&mut self, group: &mut PermissionGroup)[src]

Adds the hub member to a permission group.

pub fn leave_group(&mut self, group: &mut PermissionGroup)[src]

Removes the hub member from a permission group.

pub fn set_permission(
    &mut self,
    permission: HubPermission,
    value: PermissionSetting
)
[src]

Sets a hub permission for the hub member.

pub fn set_channel_permission(
    &mut self,
    channel: &ID,
    permission: ChannelPermission,
    value: PermissionSetting
)
[src]

Sets a channel permission for the hub member in the specified channel.

pub fn has_all_permissions(&self) -> bool[src]

Checks if the hub member has the HubPermission::All permission or if they inherit it from a permission group they are in.

pub fn has_permission(&self, permission: HubPermission, hub: &Hub) -> bool[src]

Checks if the hub member has the given hub permission or if they inherit it from a permission group they are in.

pub fn has_channel_permission(
    &self,
    channel: &ID,
    permission: ChannelPermission,
    hub: &Hub
) -> bool
[src]

Checks if the hub member has the given channel permission in the given channel or if they inherit it from a permission group they are in.

Trait Implementations

impl Clone for HubMember[src]

impl ContainerType for HubMember[src]

impl Debug for HubMember[src]

impl<'de> Deserialize<'de> for HubMember[src]

impl ObjectType for HubMember[src]

impl OutputType for HubMember[src]

impl PartialEq<HubMember> for HubMember[src]

impl Serialize for HubMember[src]

impl StructuralPartialEq for HubMember[src]

impl Type for HubMember[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> From<T> for T[src]

impl<T> Fruit for T where
    T: Send + Downcast, 
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T[src]

type Err = Infallible

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,