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> PartialOrd for Handle<T>where
T: PartialOrd,
impl<T> PartialOrd for Handle<T>where
T: PartialOrd,
Source§impl Sweep for Handle<Face>
impl Sweep for Handle<Face>
Source§fn sweep_with_cache(
self,
path: impl Into<Vector<3>>,
cache: &mut SweepCache,
services: &mut Services,
) -> Self::Swept
fn sweep_with_cache( self, path: impl Into<Vector<3>>, cache: &mut SweepCache, services: &mut Services, ) -> 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,
services: &mut Services,
) -> Self::Swept
fn sweep_with_cache( self, path: impl Into<Vector<3>>, cache: &mut SweepCache, services: &mut Services, ) -> Self::Swept
Sweep the object along the given path, using the provided cache
Source§impl Sweep for Handle<Vertex>
impl Sweep for Handle<Vertex>
Source§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,
services: &mut Services,
) -> Self::Swept
fn sweep_with_cache( self, _: impl Into<Vector<3>>, cache: &mut SweepCache, services: &mut Services, ) -> Self::Swept
Sweep the object along the given path, using the provided cache
Source§impl<T> TransformObject for Handle<T>
impl<T> TransformObject for Handle<T>
Source§fn transform_with_cache(
self,
transform: &Transform,
services: &mut Services,
cache: &mut TransformCache,
) -> Self
fn transform_with_cache( self, transform: &Transform, services: &mut Services, cache: &mut TransformCache, ) -> Self
Transform the object using the provided cache
Source§fn transform(self, transform: &Transform, services: &mut Services) -> Self
fn transform(self, transform: &Transform, services: &mut Services) -> 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§
impl<T> Freeze for Handle<T>
impl<T> !RefUnwindSafe for Handle<T>
impl<T> Unpin for Handle<T>
impl<T> !UnwindSafe for Handle<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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.