pub struct Organization {
pub id: String,
pub name: String,
pub description: Option<String>,
pub members: Vec<String>,
pub groups: Vec<String>,
pub created_at: DateTime<Utc>,
pub metadata: HashMap<String, String>,
}Expand description
An organization that can contain identities and groups.
Fields§
§id: StringUnique identifier (slug).
name: StringHuman-readable name.
description: Option<String>Optional description.
members: Vec<String>Member identity IDs.
groups: Vec<String>Group IDs within this organization.
created_at: DateTime<Utc>When this organization was created.
metadata: HashMap<String, String>Arbitrary key-value metadata.
Implementations§
Source§impl Organization
impl Organization
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 add_group(&mut self, group_id: &str) -> Result<(), IdentityError>
pub fn add_group(&mut self, group_id: &str) -> Result<(), IdentityError>
Add a group ID. Returns error if duplicate.
Sourcepub fn remove_group(&mut self, group_id: &str) -> bool
pub fn remove_group(&mut self, group_id: &str) -> bool
Remove a group ID. Returns true if removed.
Trait Implementations§
Source§impl Clone for Organization
impl Clone for Organization
Source§fn clone(&self) -> Organization
fn clone(&self) -> Organization
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Organization
impl Debug for Organization
Source§impl<'de> Deserialize<'de> for Organization
impl<'de> Deserialize<'de> for Organization
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
Source§impl Display for Organization
impl Display for Organization
Source§impl PartialEq for Organization
impl PartialEq for Organization
Source§impl Serialize for Organization
impl Serialize for Organization
impl Eq for Organization
impl StructuralPartialEq for Organization
Auto Trait Implementations§
impl Freeze for Organization
impl RefUnwindSafe for Organization
impl Send for Organization
impl Sync for Organization
impl Unpin for Organization
impl UnsafeUnpin for Organization
impl UnwindSafe for Organization
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.