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]
&mut self,
permission: HubPermission,
value: PermissionSetting
)
Sets a hub permission for the hub member.
pub fn set_channel_permission(
&mut self,
channel: &ID,
permission: ChannelPermission,
value: PermissionSetting
)
[src]
&mut self,
channel: &ID,
permission: ChannelPermission,
value: PermissionSetting
)
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]
&self,
channel: &ID,
permission: ChannelPermission,
hub: &Hub
) -> bool
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]
fn resolve_field<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Context<'life2>
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
ctx: &'life1 Context<'life2>
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn find_entity<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ctx: &'life1 Context<'life2>,
params: &'life3 Value
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
ctx: &'life1 Context<'life2>,
params: &'life3 Value
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
pub fn collect_all_fields(
&'a self,
ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>,
fields: &mut Fields<'a>
) -> Result<(), ServerError> where
Self: Send + Sync,
[src]
&'a self,
ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>,
fields: &mut Fields<'a>
) -> Result<(), ServerError> where
Self: Send + Sync,
impl Debug for HubMember
[src]
impl<'de> Deserialize<'de> for HubMember
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl ObjectType for HubMember
[src]
impl OutputType for HubMember
[src]
fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ctx: &'life1 ContextSelectionSet<'life2>,
_field: &'life3 Positioned<Field>
) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
ctx: &'life1 ContextSelectionSet<'life2>,
_field: &'life3 Positioned<Field>
) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
impl PartialEq<HubMember> for HubMember
[src]
impl Serialize for HubMember
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for HubMember
[src]
impl Type for HubMember
[src]
fn type_name() -> Cow<'static, str>
[src]
fn create_type_info(registry: &mut Registry) -> String
[src]
pub fn qualified_type_name() -> String
[src]
pub fn introspection_type_name(&self) -> Cow<'static, str>
[src]
Auto Trait Implementations
impl RefUnwindSafe for HubMember
impl Send for HubMember
impl Sync for HubMember
impl Unpin for HubMember
impl UnwindSafe for HubMember
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, 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,