pub struct Group {
pub id: String,
pub name: String,
pub description: Option<String>,
pub members: Vec<String>,
pub created_at: DateTime<Utc>,
pub metadata: HashMap<String, String>,
}Expand description
A named group of identities within an organization.
Groups are used for role-based access and approval routing. For example, a “reviewers” group might be required to approve design phases.
Fields§
§id: StringUnique identifier (slug).
name: StringHuman-readable name.
description: Option<String>Optional description of this group’s purpose.
members: Vec<String>Member identity IDs.
created_at: DateTime<Utc>When this group was created.
metadata: HashMap<String, String>Arbitrary key-value metadata.
Implementations§
Source§impl Group
impl Group
Sourcepub fn add_member(&mut self, identity_id: &str) -> Result<(), IdentityError>
pub fn add_member(&mut self, identity_id: &str) -> Result<(), IdentityError>
Add a member identity ID. Returns error if duplicate.
Sourcepub fn remove_member(&mut self, identity_id: &str) -> bool
pub fn remove_member(&mut self, identity_id: &str) -> bool
Remove a member identity ID. Returns true if removed.
Sourcepub fn member_count(&self) -> usize
pub fn member_count(&self) -> usize
Return the number of members.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Group
impl<'de> Deserialize<'de> for Group
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
impl Eq for Group
impl StructuralPartialEq for Group
Auto Trait Implementations§
impl Freeze for Group
impl RefUnwindSafe for Group
impl Send for Group
impl Sync for Group
impl Unpin for Group
impl UnsafeUnpin for Group
impl UnwindSafe for Group
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.