pub struct Handle<T> { /* private fields */ }Expand description
A handle for an object
You can get an instance of Handle by inserting an object into a store. A
handle dereferences to the object it points to, via its Deref
implementation.
Equality and Identity
Equality of Handles is defined via the objects they reference. If those
objects are equal, the Handles are considered equal.
This is distinct from the identity of the referenced objects. Two objects might be equal, but they might be have been created at different times, for different reasons, and thus live in different slots in the storage. This is a relevant distinction when validating objects, as equal but not identical objects might be a sign of a bug.
You can compare the identity of two objects through their Handles, by
comparing the values returned by Handle::id.
Implementations§
Trait Implementations§
source§impl Extend<Handle<Face>> for FaceSet
impl Extend<Handle<Face>> for FaceSet
source§fn extend<T: IntoIterator<Item = Handle<Face>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Handle<Face>>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬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 From<Handle<GlobalEdge>> for Object<BehindHandle>
impl From<Handle<GlobalEdge>> for Object<BehindHandle>
source§fn from(object: Handle<GlobalEdge>) -> Self
fn from(object: Handle<GlobalEdge>) -> Self
Converts to this type from the input type.
source§impl<T> From<Handle<T>> for HandleWrapper<T>
impl<T> From<Handle<T>> for HandleWrapper<T>
source§impl<T> From<HandleWrapper<T>> for Handle<T>
impl<T> From<HandleWrapper<T>> for Handle<T>
source§fn from(wrapper: HandleWrapper<T>) -> Self
fn from(wrapper: HandleWrapper<T>) -> Self
Converts to this type from the input type.
source§impl<T> Ord for Handle<T>where
T: Ord,
impl<T> Ord for Handle<T>where T: Ord,
source§impl<T> PartialEq<Handle<T>> for Handle<T>where
T: PartialEq,
impl<T> PartialEq<Handle<T>> for Handle<T>where T: PartialEq,
source§impl<T> PartialOrd<Handle<T>> for Handle<T>where
T: PartialOrd,
impl<T> PartialOrd<Handle<T>> for Handle<T>where T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Sweep for Handle<Face>
impl Sweep for Handle<Face>
source§fn sweep_with_cache(
self,
path: impl Into<Vector<3>>,
cache: &mut SweepCache,
objects: &mut Service<Objects>
) -> Self::Swept
fn sweep_with_cache( self, path: impl Into<Vector<3>>, cache: &mut SweepCache, objects: &mut Service<Objects> ) -> Self::Swept
Sweep the object along the given path, using the provided cache
source§impl Sweep for Handle<Sketch>
impl Sweep for Handle<Sketch>
source§fn sweep_with_cache(
self,
path: impl Into<Vector<3>>,
cache: &mut SweepCache,
objects: &mut Service<Objects>
) -> Self::Swept
fn sweep_with_cache( self, path: impl Into<Vector<3>>, cache: &mut SweepCache, objects: &mut Service<Objects> ) -> Self::Swept
Sweep the object along the given path, using the provided cache
source§impl Sweep for Handle<Vertex>
impl Sweep for Handle<Vertex>
§type Swept = (Handle<GlobalEdge>, [Handle<Vertex>; 2])
type Swept = (Handle<GlobalEdge>, [Handle<Vertex>; 2])
The object that is created by sweeping the implementing object
source§fn sweep_with_cache(
self,
_: impl Into<Vector<3>>,
cache: &mut SweepCache,
objects: &mut Service<Objects>
) -> Self::Swept
fn sweep_with_cache( self, _: impl Into<Vector<3>>, cache: &mut SweepCache, objects: &mut Service<Objects> ) -> Self::Swept
Sweep the object along the given path, using the provided cache
source§impl<T> TransformObject for Handle<T>where
T: Clone + Insert + TransformObject + 'static,
impl<T> TransformObject for Handle<T>where T: Clone + Insert + TransformObject + 'static,
source§fn transform_with_cache(
self,
transform: &Transform,
objects: &mut Service<Objects>,
cache: &mut TransformCache
) -> Self
fn transform_with_cache( self, transform: &Transform, objects: &mut Service<Objects>, cache: &mut TransformCache ) -> Self
Transform the object using the provided cache
source§fn transform(
self,
transform: &Transform,
objects: &mut Service<Objects>
) -> Self
fn transform( self, transform: &Transform, objects: &mut Service<Objects> ) -> Self
Transform the object
impl<T> Eq for Handle<T>where T: Eq,
impl<T> Send for Handle<T>
impl<T> Sync for Handle<T>
Auto Trait Implementations§
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
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 + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.