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 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> 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<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§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) -> SystemSetConfigs
fn chain_ignore_deferred(self) -> SystemSetConfigs
Treat this collection as a sequence of systems. Read more