Struct fj_kernel::stores::HandleWrapper
source · [−]pub struct HandleWrapper<T>(pub Handle<T>);Expand description
A wrapper around Handle to define equality based on identity
This is a utility type that implements Eq/PartialEq and other common
traits that are based on those, based on the identity of object that the
wrapped handle references. This is useful, if a type of object doesn’t
implement Eq/PartialEq, which means handles referencing it won’t
implement those types either.
Typically, if an object doesn’t implement Eq/PartialEq, it will do
so for good reason. If you need something that represents the object and
implements those missing traits, you might want to be explicit about what
you’re doing, and access its ID via Handle::id instead.
But if you have a struct that owns a Handle to such an object, and you
want to be able to derive various traits that are not available for the
Handle itself, this wrapper is for you.
Tuple Fields
0: Handle<T>Methods from Deref<Target = Handle<T>>
Trait Implementations
sourceimpl<T> Clone for HandleWrapper<T>
impl<T> Clone for HandleWrapper<T>
sourceimpl<T> Debug for HandleWrapper<T>
impl<T> Debug for HandleWrapper<T>
sourceimpl<T> Deref for HandleWrapper<T>
impl<T> Deref for HandleWrapper<T>
sourceimpl<T> From<Handle<T>> for HandleWrapper<T>
impl<T> From<Handle<T>> for HandleWrapper<T>
sourceimpl<T> From<HandleWrapper<T>> for Handle<T>
impl<T> From<HandleWrapper<T>> for Handle<T>
sourcefn from(wrapper: HandleWrapper<T>) -> Self
fn from(wrapper: HandleWrapper<T>) -> Self
sourceimpl<T> Hash for HandleWrapper<T>
impl<T> Hash for HandleWrapper<T>
sourceimpl<T> Ord for HandleWrapper<T>
impl<T> Ord for HandleWrapper<T>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl<T> PartialEq<HandleWrapper<T>> for HandleWrapper<T>
impl<T> PartialEq<HandleWrapper<T>> for HandleWrapper<T>
sourceimpl<T> PartialOrd<HandleWrapper<T>> for HandleWrapper<T>
impl<T> PartialOrd<HandleWrapper<T>> for HandleWrapper<T>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl<T> Eq for HandleWrapper<T>
impl<T> Send for HandleWrapper<T>
impl<T> Sync for HandleWrapper<T>
Auto Trait Implementations
impl<T> !RefUnwindSafe for HandleWrapper<T>
impl<T> Unpin for HandleWrapper<T>
impl<T> !UnwindSafe for HandleWrapper<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn 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, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read morefn 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. Read morefn 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. Read moreimpl<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 morefn 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.