[−][src]Struct clusterphobia::clustering::cluster::Cluster
Groups zero or more members into a category as part of a Clustering.
While the members could be Copyable structs, typically they are integer ids the caller can use to obtain the real objects.
- C : Type of the Cluster Category.
- M : Type of the Cluster Members.
Methods
impl<C: Chopped, M: Chopped> Cluster<C, M>
[src]
pub fn empty(category: C) -> Self
[src]
Create an empty cluster.
pub fn with_member(category: C, member: M) -> Self
[src]
Create a cluster containing a single member.
pub fn len(&self) -> usize
[src]
Count of members in the cluster
pub fn is_empty(&self) -> bool
[src]
Is the Cluster
empty?
pub fn get_category(&self) -> C
[src]
Get the Cluster category.
pub fn get_members(&self) -> &HashSet<M>
[src]
Get the members of the cluster.
pub fn is_member(&self, item: &M) -> bool
[src]
Determines if the given item is a member of the cluster.
pub fn add_member(&mut self, item: M) -> bool
[src]
Adds a new member to the cluster.
- returns true if a new item was added,
- returns false if the item was already present in the Cluster.
pub fn remove_member(&mut self, item: &M) -> bool
[src]
Removes a member from the cluster.
- returns true item was removed,
- returns false if the item is not present in the Cluster.
pub fn merge(&mut self, other: &mut Self)
[src]
Merge two clusters, removing all members from the second and inserting them into the first.
Trait Implementations
impl<C: Clone + Chopped, M: Clone + Chopped> Clone for Cluster<C, M>
[src]
impl<C: Chopped, M: Chopped> Eq for Cluster<C, M>
[src]
impl<C: Chopped, M: Chopped> Ord for Cluster<C, M>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<C: Chopped, M: Chopped> PartialEq<Cluster<C, M>> for Cluster<C, M>
[src]
impl<C: Chopped, M: Chopped> PartialOrd<Cluster<C, M>> for Cluster<C, M>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<C: Chopped, M: Chopped> Debug for Cluster<C, M>
[src]
Auto Trait Implementations
impl<C, M> Send for Cluster<C, M> where
C: Send,
M: Send,
C: Send,
M: Send,
impl<C, M> Sync for Cluster<C, M> where
C: Sync,
M: Sync,
C: Sync,
M: Sync,
impl<C, M> Unpin for Cluster<C, M> where
C: Unpin,
M: Unpin,
C: Unpin,
M: Unpin,
impl<C, M> UnwindSafe for Cluster<C, M> where
C: UnwindSafe,
M: UnwindSafe,
C: UnwindSafe,
M: UnwindSafe,
impl<C, M> RefUnwindSafe for Cluster<C, M> where
C: RefUnwindSafe,
M: RefUnwindSafe,
C: RefUnwindSafe,
M: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,