pub struct Circle {
pub id: CircleId,
pub name: String,
pub purpose: String,
pub parent_circle: Option<CircleId>,
pub members: HashSet<MemberId>,
pub roles: HashMap<RoleId, Role>,
pub domains: Vec<String>,
}Expand description
A circle (team/domain) in the organization
Fields§
§id: CircleIdUnique identifier
name: StringHuman-readable name
purpose: StringPurpose/mission
parent_circle: Option<CircleId>Parent circle (if any)
members: HashSet<MemberId>Member IDs in this circle
roles: HashMap<RoleId, Role>Roles defined in this circle
domains: Vec<String>Domains/authorities
Implementations§
Source§impl Circle
impl Circle
pub fn new( id: impl Into<String>, name: impl Into<String>, purpose: impl Into<String>, ) -> Self
pub fn with_parent(self, parent: impl Into<String>) -> Self
pub fn with_domains(self, domains: Vec<String>) -> Self
pub fn add_member(&mut self, member_id: impl Into<String>) -> bool
pub fn remove_member(&mut self, member_id: &str) -> bool
pub fn add_role(&mut self, role: Role) -> Option<Role>
pub fn remove_role(&mut self, role_id: &str) -> Option<Role>
pub fn get_role(&self, role_id: &str) -> Option<&Role>
pub fn member_count(&self) -> usize
pub fn role_count(&self) -> usize
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Circle
impl<'de> Deserialize<'de> for Circle
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 StructuralPartialEq for Circle
Auto Trait Implementations§
impl Freeze for Circle
impl RefUnwindSafe for Circle
impl Send for Circle
impl Sync for Circle
impl Unpin for Circle
impl UnsafeUnpin for Circle
impl UnwindSafe for Circle
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,
impl<T> Component for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more