pub struct UnionFindGeneric<NodeType: UnionNodeTrait> {
pub link_parent: Vec<usize>,
pub payload: Vec<NodeType>,
/* private fields */
}Fields§
§link_parent: Vec<usize>tree structure, each node has a parent
payload: Vec<NodeType>the node information, has the same length as link_parent
Implementations§
Source§impl<NodeType: UnionNodeTrait> UnionFindGeneric<NodeType>
impl<NodeType: UnionNodeTrait> UnionFindGeneric<NodeType>
pub fn new(len: usize) -> Self
pub fn size(&self) -> usize
pub fn insert(&mut self, data: NodeType) -> usize
pub fn union(&mut self, key0: usize, key1: usize) -> bool
pub fn find(&mut self, key: usize) -> usize
pub fn immutable_find(&self, key: usize) -> usize
pub fn get(&mut self, key: usize) -> &NodeType
pub fn immutable_get(&self, key: usize) -> &NodeType
pub fn get_mut(&mut self, key: usize) -> &mut NodeType
pub fn clear(&mut self)
pub fn remove_all(&mut self)
Trait Implementations§
Source§impl<NodeType: Clone + UnionNodeTrait> Clone for UnionFindGeneric<NodeType>
impl<NodeType: Clone + UnionNodeTrait> Clone for UnionFindGeneric<NodeType>
Source§impl<NodeType: Debug + UnionNodeTrait> Debug for UnionFindGeneric<NodeType>
impl<NodeType: Debug + UnionNodeTrait> Debug for UnionFindGeneric<NodeType>
Source§impl<NodeType: UnionNodeTrait> Default for UnionFindGeneric<NodeType>
impl<NodeType: UnionNodeTrait> Default for UnionFindGeneric<NodeType>
Source§impl<'de, NodeType> Deserialize<'de> for UnionFindGeneric<NodeType>where
NodeType: Deserialize<'de> + UnionNodeTrait,
impl<'de, NodeType> Deserialize<'de> for UnionFindGeneric<NodeType>where
NodeType: Deserialize<'de> + UnionNodeTrait,
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<NodeType: UnionNodeTrait> Extend<NodeType> for UnionFindGeneric<NodeType>
impl<NodeType: UnionNodeTrait> Extend<NodeType> for UnionFindGeneric<NodeType>
Source§fn extend<T: IntoIterator<Item = NodeType>>(&mut self, iterable: T)
fn extend<T: IntoIterator<Item = NodeType>>(&mut self, iterable: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<NodeType: UnionNodeTrait> FromIterator<NodeType> for UnionFindGeneric<NodeType>
impl<NodeType: UnionNodeTrait> FromIterator<NodeType> for UnionFindGeneric<NodeType>
Source§fn from_iter<T: IntoIterator<Item = NodeType>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = NodeType>>(iterator: T) -> Self
Creates a value from an iterator. Read more
Source§impl<NodeType> Serialize for UnionFindGeneric<NodeType>where
NodeType: Serialize + UnionNodeTrait,
impl<NodeType> Serialize for UnionFindGeneric<NodeType>where
NodeType: Serialize + UnionNodeTrait,
Auto Trait Implementations§
impl<NodeType> Forget for UnionFindGeneric<NodeType>
impl<NodeType> Freeze for UnionFindGeneric<NodeType>
impl<NodeType> Move for UnionFindGeneric<NodeType>
impl<NodeType> RefUnwindSafe for UnionFindGeneric<NodeType>where
Vec<NodeType>: RefUnwindSafe,
impl<NodeType> Send for UnionFindGeneric<NodeType>
impl<NodeType> Sync for UnionFindGeneric<NodeType>
impl<NodeType> Unpin for UnionFindGeneric<NodeType>
impl<NodeType> UnsafeUnpin for UnionFindGeneric<NodeType>where
Vec<NodeType>: UnsafeUnpin,
impl<NodeType> UnwindSafe for UnionFindGeneric<NodeType>where
Vec<NodeType>: UnwindSafe,
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request