pub struct Group {
pub id: GroupId,
pub name: Option<String>,
pub members: HashSet<NodeId>,
pub position: Position,
pub size: Size,
pub collapsed: bool,
pub color: Option<String>,
pub parent_group: Option<GroupId>,
pub child_groups: HashSet<GroupId>,
}Expand description
Node group with metadata and member management
Fields§
§id: GroupId§name: Option<String>§members: HashSet<NodeId>§position: Position§size: Size§collapsed: bool§color: Option<String>§parent_group: Option<GroupId>§child_groups: HashSet<GroupId>Implementations§
Source§impl Group
impl Group
Sourcepub fn new(id: GroupId, members: HashSet<NodeId>) -> Self
pub fn new(id: GroupId, members: HashSet<NodeId>) -> Self
Create a new group with the given members
Sourcepub fn contains_node(&self, node_id: &NodeId) -> bool
pub fn contains_node(&self, node_id: &NodeId) -> bool
Check if the group contains a specific node
Sourcepub fn member_count(&self) -> usize
pub fn member_count(&self) -> usize
Get the number of members in this group
Sourcepub fn add_member(&mut self, node_id: NodeId) -> bool
pub fn add_member(&mut self, node_id: NodeId) -> bool
Add a node to this group
Sourcepub fn remove_member(&mut self, node_id: &NodeId) -> bool
pub fn remove_member(&mut self, node_id: &NodeId) -> bool
Remove a node from this group
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Group
impl RefUnwindSafe for Group
impl Send for Group
impl Sync for Group
impl Unpin 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