pub struct ObjectSet<T> { /* private fields */ }Expand description
An ordered set of objects
This is the data structure used by all objects that reference multiple objects of the same type. It is a set, not containing any duplicate elements, and it maintains the insertion order of those elements.
Implementations§
source§impl<T> ObjectSet<T>
impl<T> ObjectSet<T>
sourcepub fn new(handles: impl IntoIterator<Item = Handle<T>>) -> Self
pub fn new(handles: impl IntoIterator<Item = Handle<T>>) -> Self
Create an instances of ObjectSet from an iterator over Handle<T>
Panics
Panics, if the iterator contains duplicate Handles.
sourcepub fn contains(&self, object: &Handle<T>) -> bool
pub fn contains(&self, object: &Handle<T>) -> bool
Indicate whether the set contains the provided object
sourcepub fn nth_circular(&self, index: usize) -> &Handle<T>
pub fn nth_circular(&self, index: usize) -> &Handle<T>
Return the n-th item, treating the index space as circular
If the length of ObjectSet is i, then retrieving the i-th edge using
this method, is the same as retrieving the 0-th one, and so on.
Panics
Panics, if ObjectSet is empty.
sourcepub fn index_of(&self, handle: &Handle<T>) -> Option<usize>
pub fn index_of(&self, handle: &Handle<T>) -> Option<usize>
Return the index of the item, if available
sourcepub fn after(&self, handle: &Handle<T>) -> Option<&Handle<T>>
pub fn after(&self, handle: &Handle<T>) -> Option<&Handle<T>>
Access the item after the provided one
Returns None, if the provided item is not in this iterator.
sourcepub fn pairs(&self) -> impl Iterator<Item = (&Handle<T>, &Handle<T>)>
pub fn pairs(&self) -> impl Iterator<Item = (&Handle<T>, &Handle<T>)>
Access an iterator over the neighboring pairs of all contained objects
Trait Implementations§
source§impl Approx for &ObjectSet<Face>
impl Approx for &ObjectSet<Face>
§type Approximation = BTreeSet<FaceApprox>
type Approximation = BTreeSet<FaceApprox>
§type Cache = HalfEdgeApproxCache
type Cache = HalfEdgeApproxCache
source§fn approx_with_cache(
self,
tolerance: impl Into<Tolerance>,
cache: &mut Self::Cache
) -> Self::Approximation
fn approx_with_cache( self, tolerance: impl Into<Tolerance>, cache: &mut Self::Cache ) -> Self::Approximation
source§impl<O> FromIterator<Handle<O>> for ObjectSet<O>
impl<O> FromIterator<Handle<O>> for ObjectSet<O>
source§impl<'r, T> IntoIterator for &'r ObjectSet<T>
impl<'r, T> IntoIterator for &'r ObjectSet<T>
source§impl<T> IntoIterator for ObjectSet<T>
impl<T> IntoIterator for ObjectSet<T>
source§impl<T: Ord> Ord for ObjectSet<T>
impl<T: Ord> Ord for ObjectSet<T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<T: PartialEq> PartialEq for ObjectSet<T>
impl<T: PartialEq> PartialEq for ObjectSet<T>
source§impl<T: PartialOrd> PartialOrd for ObjectSet<T>
impl<T: PartialOrd> PartialOrd for ObjectSet<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl<T: Eq> Eq for ObjectSet<T>
impl<T> StructuralEq for ObjectSet<T>
impl<T> StructuralPartialEq for ObjectSet<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ObjectSet<T>
impl<T> Send for ObjectSet<T>
impl<T> Sync for ObjectSet<T>
impl<T> Unpin for ObjectSet<T>
impl<T> !UnwindSafe for ObjectSet<T>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.