pub struct Elements {
pub nodes: Nodes,
pub edges: Edges,
}Expand description
A set of elment (node and edge) identifiers.
Fields§
§nodes: Nodes§edges: EdgesImplementations§
Source§impl Elements
impl Elements
pub fn new(nodes: Nodes, edges: Edges) -> Self
pub fn from_nodes(nodes: Nodes) -> Self
pub fn from_edges(edges: Edges) -> Self
pub fn from_elements(elements: &[ElementID]) -> Self
Source§impl Elements
impl Elements
Sourcepub fn contains(&self, member: &ElementID) -> bool
pub fn contains(&self, member: &ElementID) -> bool
Returns true if the set contains an element equal to the value.
Sourcepub fn insert(&mut self, new_member: ElementID) -> bool
pub fn insert(&mut self, new_member: ElementID) -> bool
Inserts a value into the set, returning true if the value was not present in the set.
Sourcepub fn insert_all(&mut self, other: &Elements)
pub fn insert_all(&mut self, other: &Elements)
Inserts all the elements from other into self.
Sourcepub fn remove(&mut self, member: &ElementID) -> bool
pub fn remove(&mut self, member: &ElementID) -> bool
Removes a value from the set, returning the value if it was present in the set.
Sourcepub fn remove_all(&mut self, other: &Elements)
pub fn remove_all(&mut self, other: &Elements)
Removes all the elements in other from self.
Sourcepub fn union(&self, other: &Elements) -> Elements
pub fn union(&self, other: &Elements) -> Elements
Returns the elements representing the union, i.e., all the elements in self or other.
Sourcepub fn intersection(&self, other: &Elements) -> Elements
pub fn intersection(&self, other: &Elements) -> Elements
Returns the elements representing the intersection, i.e., all the elements in both self and other.
Sourcepub fn difference(&self, other: &Elements) -> Elements
pub fn difference(&self, other: &Elements) -> Elements
Returns the elements representing the difference, i.e., all the elements in self but not in other.
Sourcepub fn symmetric_difference(&self, other: &Elements) -> Elements
pub fn symmetric_difference(&self, other: &Elements) -> Elements
Returns the elements representing the symmetric difference, i.e., all the elements in self or other, but not in both.
Sourcepub fn form_union(&mut self, other: &Elements)
pub fn form_union(&mut self, other: &Elements)
Updates self with the union of self and other.
Sourcepub fn form_intersection(&mut self, other: &Elements)
pub fn form_intersection(&mut self, other: &Elements)
Updates self with the intersection of self and other.
Sourcepub fn form_difference(&mut self, other: &Elements)
pub fn form_difference(&mut self, other: &Elements)
Updates self with the difference of self and other.
Sourcepub fn form_symmetric_difference(&mut self, other: &Elements)
pub fn form_symmetric_difference(&mut self, other: &Elements)
Updates self with the symmetric difference of self and other.
Sourcepub fn is_disjoint(&self, other: &Elements) -> bool
pub fn is_disjoint(&self, other: &Elements) -> bool
Returns true if self has no elements in common with other. This is equivalent to checking for an empty intersection.
Sourcepub fn is_subset(&self, other: &Elements) -> bool
pub fn is_subset(&self, other: &Elements) -> bool
Returns true if self is a subset of other, i.e., other contains at least all the elements in self.
Sourcepub fn is_superset(&self, other: &Elements) -> bool
pub fn is_superset(&self, other: &Elements) -> bool
Returns true if self is a superset of other, i.e., self contains at least all the elements in other.