pub struct MapSome<Upstream, I, O> { /* private fields */ }
Expand description
Represents a node that maps a Some(T)
signal value using a system. Implements Signal
.
Executes the provided system some_system
only when the upstream signal emits Some(T)
, passing T
via In
.
Trait Implementations§
Source§impl<Upstream, I, O> Signal for MapSome<Upstream, I, O>where
Upstream: Signal<Item = Option<I>>,
Upstream::Item: FromReflect + SSs,
I: FromReflect + GetTypeRegistration + Typed + SSs,
O: FromReflect + SSs,
impl<Upstream, I, O> Signal for MapSome<Upstream, I, O>where
Upstream: Signal<Item = Option<I>>,
Upstream::Item: FromReflect + SSs,
I: FromReflect + GetTypeRegistration + Typed + SSs,
O: FromReflect + SSs,
Source§fn register_signal(self, world: &mut World) -> SignalHandle
fn register_signal(self, world: &mut World) -> SignalHandle
Registers the systems associated with this node and its predecessors in the
World
.
Returns a SignalHandle
containing the entities of all systems
registered or reference-counted during this specific registration call instance.
Note: This method is intended for internal use by the signal combinators and registration process.Auto Trait Implementations§
impl<Upstream, I, O> Freeze for MapSome<Upstream, I, O>where
Upstream: Freeze,
impl<Upstream, I, O> RefUnwindSafe for MapSome<Upstream, I, O>
impl<Upstream, I, O> Send for MapSome<Upstream, I, O>
impl<Upstream, I, O> Sync for MapSome<Upstream, I, O>
impl<Upstream, I, O> Unpin for MapSome<Upstream, I, O>
impl<Upstream, I, O> UnwindSafe for MapSome<Upstream, I, O>
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<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<T> SignalExt for Twhere
T: Signal,
impl<T> SignalExt for Twhere
T: Signal,
Source§fn map<O, IOO, F, M>(self, system: F) -> Map<Self, O>where
Self: Sized,
Self::Item: FromReflect + SSs,
O: FromReflect + SSs,
IOO: Into<Option<O>> + SSs,
F: IntoSystem<In<Self::Item>, IOO, M> + Send + Sync + 'static,
M: SSs,
fn map<O, IOO, F, M>(self, system: F) -> Map<Self, O>where
Self: Sized,
Self::Item: FromReflect + SSs,
O: FromReflect + SSs,
IOO: Into<Option<O>> + SSs,
F: IntoSystem<In<Self::Item>, IOO, M> + Send + Sync + 'static,
M: SSs,
Appends a transformation step to the signal chain using a Bevy system. Read more
Source§fn component<C>(self) -> MapComponent<Self, C>
fn component<C>(self) -> MapComponent<Self, C>
Source§fn component_option<C>(self) -> ComponentOption<Self, C>where
Self: Sized + Signal<Item = Entity>,
C: Component + Clone + FromReflect + GetTypeRegistration + Typed + SSs,
fn component_option<C>(self) -> ComponentOption<Self, C>where
Self: Sized + Signal<Item = Entity>,
C: Component + Clone + FromReflect + GetTypeRegistration + Typed + SSs,
Source§fn has_component<C>(self) -> HasComponent<Self, C>
fn has_component<C>(self) -> HasComponent<Self, C>
Checks if an entity from an entity signal has component
C
. Read moreSource§fn dedupe(self) -> Dedupe<Self>
fn dedupe(self) -> Dedupe<Self>
Filters out consecutive duplicate values from the signal. Read more
Source§fn first(self) -> First<Self>
fn first(self) -> First<Self>
Emits only the very first value received from the upstream signal. Read more
Source§fn combine<Other>(self, other: Other) -> Combine<Self, Other>where
Self: Sized,
Other: Signal,
Self::Item: FromReflect + GetTypeRegistration + Typed + SSs,
Other::Item: FromReflect + GetTypeRegistration + Typed + SSs,
fn combine<Other>(self, other: Other) -> Combine<Self, Other>where
Self: Sized,
Other: Signal,
Self::Item: FromReflect + GetTypeRegistration + Typed + SSs,
Other::Item: FromReflect + GetTypeRegistration + Typed + SSs,
Combines this signal with another signal (
other
). Read moreSource§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Flattens a signal where the item type is itself a signal (
Signal<Item = impl Signal>
). Read moreSource§fn eq(self, value: Self::Item) -> Eq<Self>
fn eq(self, value: Self::Item) -> Eq<Self>
Compares the signal’s value for equality with a fixed
value
. Read moreSource§fn neq(self, value: Self::Item) -> Neq<Self>
fn neq(self, value: Self::Item) -> Neq<Self>
Compares the signal’s value for inequality with a fixed
value
. Read moreSource§fn filter<M>(
self,
predicate: impl IntoSystem<In<Self::Item>, bool, M> + Send + Sync + 'static,
) -> Filter<Self>
fn filter<M>( self, predicate: impl IntoSystem<In<Self::Item>, bool, M> + Send + Sync + 'static, ) -> Filter<Self>
Filters the signal based on a predicate system. Read more
Source§fn switch<S, F, M>(self, switcher: F) -> Switch<Self, S>where
Self: Sized,
Self::Item: FromReflect + SSs,
S: Signal + Clone + FromReflect + SSs,
S::Item: FromReflect + SSs + Clone,
F: IntoSystem<In<Self::Item>, S, M> + Send + Sync + 'static,
M: SSs,
fn switch<S, F, M>(self, switcher: F) -> Switch<Self, S>where
Self: Sized,
Self::Item: FromReflect + SSs,
S: Signal + Clone + FromReflect + SSs,
S::Item: FromReflect + SSs + Clone,
F: IntoSystem<In<Self::Item>, S, M> + Send + Sync + 'static,
M: SSs,
Dynamically switches the signal’s behavior based on its own output. Read more
Source§fn throttle(self, duration: Duration) -> Throttle<Self>
fn throttle(self, duration: Duration) -> Throttle<Self>
Throttles the signal, ensuring a minimum duration between emitted values. Read more
Source§fn map_bool<O, IOO, TF, FF, TM, FM>(
self,
true_system: TF,
false_system: FF,
) -> MapBool<Self, O>
fn map_bool<O, IOO, TF, FF, TM, FM>( self, true_system: TF, false_system: FF, ) -> MapBool<Self, O>
Maps the signal’s value using one of two systems based on the upstream boolean signal. Read more
Source§fn map_true<O, IOO, TF, TM>(self, system: TF) -> MapTrue<Self, O>
fn map_true<O, IOO, TF, TM>(self, system: TF) -> MapTrue<Self, O>
Maps the signal’s value using a system only if the upstream boolean signal is
true
. Read moreSource§fn map_false<O, IOO, FF, FM>(self, system: FF) -> MapFalse<Self, O>
fn map_false<O, IOO, FF, FM>(self, system: FF) -> MapFalse<Self, O>
Maps the signal’s value using a system only if the upstream boolean signal is
false
. Read moreSource§fn map_option<I, O, IOO, SF, NF, SM, NM>(
self,
some_system: SF,
none_system: NF,
) -> MapOption<Self, I, O>where
Self: Sized + Signal<Item = Option<I>>,
I: FromReflect + GetTypeRegistration + Typed + SSs,
O: FromReflect + SSs,
IOO: Into<Option<O>> + SSs,
SF: IntoSystem<In<I>, IOO, SM> + Send + Sync + 'static,
NF: IntoSystem<In<()>, IOO, NM> + Send + Sync + 'static,
SM: SSs,
NM: SSs,
fn map_option<I, O, IOO, SF, NF, SM, NM>(
self,
some_system: SF,
none_system: NF,
) -> MapOption<Self, I, O>where
Self: Sized + Signal<Item = Option<I>>,
I: FromReflect + GetTypeRegistration + Typed + SSs,
O: FromReflect + SSs,
IOO: Into<Option<O>> + SSs,
SF: IntoSystem<In<I>, IOO, SM> + Send + Sync + 'static,
NF: IntoSystem<In<()>, IOO, NM> + Send + Sync + 'static,
SM: SSs,
NM: SSs,
Source§fn map_some<I, O, IOO, SF, SM>(self, system: SF) -> MapSome<Self, I, O>where
Self: Sized + Signal<Item = Option<I>>,
I: FromReflect + GetTypeRegistration + Typed + SSs,
O: FromReflect + SSs,
IOO: Into<Option<O>> + SSs,
SF: IntoSystem<In<I>, IOO, SM> + Send + Sync + 'static,
SM: SSs,
fn map_some<I, O, IOO, SF, SM>(self, system: SF) -> MapSome<Self, I, O>where
Self: Sized + Signal<Item = Option<I>>,
I: FromReflect + GetTypeRegistration + Typed + SSs,
O: FromReflect + SSs,
IOO: Into<Option<O>> + SSs,
SF: IntoSystem<In<I>, IOO, SM> + Send + Sync + 'static,
SM: SSs,
Maps the signal’s value using a system only if the upstream signal emits
Some(T)
. Read moreSource§fn map_none<I, O, IOO, NF, NM>(self, none_system: NF) -> MapNone<Self, I, O>where
Self: Sized + Signal<Item = Option<I>>,
I: FromReflect + GetTypeRegistration + Typed + SSs,
O: FromReflect + SSs,
IOO: Into<Option<O>> + SSs,
NF: IntoSystem<In<()>, IOO, NM> + Send + Sync + 'static,
NM: SSs,
fn map_none<I, O, IOO, NF, NM>(self, none_system: NF) -> MapNone<Self, I, O>where
Self: Sized + Signal<Item = Option<I>>,
I: FromReflect + GetTypeRegistration + Typed + SSs,
O: FromReflect + SSs,
IOO: Into<Option<O>> + SSs,
NF: IntoSystem<In<()>, IOO, NM> + Send + Sync + 'static,
NM: SSs,
Maps the signal’s value using a system only if the upstream signal emits
None
. Read moreSource§fn debug(self) -> SignalDebug<Self>
fn debug(self) -> SignalDebug<Self>
Adds debug logging to the signal chain. Read more