pub struct Interned<T: ?Sized + 'static>(pub &'static T);
Expand description
An interned value. Will stay valid until the end of the program and will not drop.
For details on interning, see the module level docs.
§Comparisons
Interned values use reference equality, meaning they implement Eq
and Hash
regardless of whether T
implements these traits.
Two interned values are only guaranteed to compare equal if they were interned using
the same Interner
instance.
#[derive(PartialEq, Eq, Hash, Debug)]
struct Value(i32);
impl Internable for Value {
// ...
}
let interner_1 = Interner::new();
let interner_2 = Interner::new();
// Even though both values are identical, their interned forms do not
// compare equal as they use different interner instances.
assert_ne!(interner_1.intern(&Value(42)), interner_2.intern(&Value(42)));
Tuple Fields§
§0: &'static T
Trait Implementations§
source§impl<T: ?Sized + Internable> PartialEq for Interned<T>
impl<T: ?Sized + Internable> PartialEq for Interned<T>
source§impl ScheduleLabel for Interned<dyn ScheduleLabel>
impl ScheduleLabel for Interned<dyn ScheduleLabel>
source§impl SystemSet for Interned<dyn SystemSet>
impl SystemSet for Interned<dyn SystemSet>
source§fn as_dyn_eq(&self) -> &dyn DynEq
fn as_dyn_eq(&self) -> &dyn DynEq
Casts this value to a form where it can be compared with other type-erased values.
source§fn system_type(&self) -> Option<TypeId>
fn system_type(&self) -> Option<TypeId>
Returns
Some
if this system set is a SystemTypeSet
.source§fn is_anonymous(&self) -> bool
fn is_anonymous(&self) -> bool
Returns
true
if this system set is an AnonymousSet
.impl<T: ?Sized> Copy for Interned<T>
impl<T: ?Sized + Internable> Eq for Interned<T>
Auto Trait Implementations§
impl<T> Freeze for Interned<T>where
T: ?Sized,
impl<T> RefUnwindSafe for Interned<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for Interned<T>
impl<T> Sync for Interned<T>
impl<T> Unpin for Interned<T>where
T: ?Sized,
impl<T> UnwindSafe for Interned<T>where
T: RefUnwindSafe + ?Sized,
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> 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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<S> IntoSystemSet<()> for Swhere
S: SystemSet,
impl<S> IntoSystemSet<()> for Swhere
S: SystemSet,
source§fn into_system_set(self) -> <S as IntoSystemSet<()>>::Set
fn into_system_set(self) -> <S as IntoSystemSet<()>>::Set
Converts this instance to its associated
SystemSet
type.source§impl<S> IntoSystemSetConfigs for Swhere
S: SystemSet,
impl<S> IntoSystemSetConfigs for Swhere
S: SystemSet,
fn into_configs(self) -> NodeConfigs<Interned<dyn SystemSet>>
source§fn in_set(self, set: impl SystemSet) -> SystemSetConfigs
fn in_set(self, set: impl SystemSet) -> SystemSetConfigs
Add these system sets to the provided
set
.source§fn before<M>(self, set: impl IntoSystemSet<M>) -> SystemSetConfigs
fn before<M>(self, set: impl IntoSystemSet<M>) -> SystemSetConfigs
source§fn after<M>(self, set: impl IntoSystemSet<M>) -> SystemSetConfigs
fn after<M>(self, set: impl IntoSystemSet<M>) -> SystemSetConfigs
source§fn before_ignore_deferred<M>(
self,
set: impl IntoSystemSet<M>
) -> SystemSetConfigs
fn before_ignore_deferred<M>( self, set: impl IntoSystemSet<M> ) -> SystemSetConfigs
Run before all systems in
set
. Read moresource§fn after_ignore_deferred<M>(
self,
set: impl IntoSystemSet<M>
) -> SystemSetConfigs
fn after_ignore_deferred<M>( self, set: impl IntoSystemSet<M> ) -> SystemSetConfigs
Run after all systems in
set
. Read moresource§fn run_if<M>(self, condition: impl Condition<M>) -> SystemSetConfigs
fn run_if<M>(self, condition: impl Condition<M>) -> SystemSetConfigs
source§fn ambiguous_with<M>(self, set: impl IntoSystemSet<M>) -> SystemSetConfigs
fn ambiguous_with<M>(self, set: impl IntoSystemSet<M>) -> SystemSetConfigs
Suppress warnings and errors that would result from systems in these sets having ambiguities
(conflicting access but indeterminate order) with systems in
set
.source§fn ambiguous_with_all(self) -> SystemSetConfigs
fn ambiguous_with_all(self) -> SystemSetConfigs
Suppress warnings and errors that would result from systems in these sets having ambiguities
(conflicting access but indeterminate order) with any other system.
source§fn chain(self) -> SystemSetConfigs
fn chain(self) -> SystemSetConfigs
Treat this collection as a sequence of system sets. Read more
source§fn chain_ignore_deferred(self) -> SystemConfigs
fn chain_ignore_deferred(self) -> SystemConfigs
Treat this collection as a sequence of systems. Read more