Struct bevy_impulse::AsyncService
source · #[non_exhaustive]pub struct AsyncService<Request, Streams: StreamPack = ()> {
pub request: Request,
pub streams: Streams::Channel,
pub channel: Channel,
pub provider: Entity,
pub source: Entity,
pub session: Entity,
}
Expand description
Use AsyncService
to indicate that your system is an async Service
. Being
async means it must return a Future<Output=Response>
which will be processed by a task pool.
This comes with a Channel
that allows your Future to interact with Bevy’s
ECS asynchronously while it is polled from inside the task pool.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.request: Request
The input data of the request
streams: Streams::Channel
Stream channels that will let you send stream information. This will
usually be a StreamChannel
or a (possibly nested) tuple of
StreamChannel
s, whichever matches the StreamPack
description.
channel: Channel
The channel that allows querying and syncing with the world while the service runs asynchronously.
provider: Entity
The entity providing the service
source: Entity
The node in a workflow or impulse chain that asked for the service
session: Entity
The unique session ID for the workflow
Auto Trait Implementations§
impl<Request, Streams> Freeze for AsyncService<Request, Streams>
impl<Request, Streams = ()> !RefUnwindSafe for AsyncService<Request, Streams>
impl<Request, Streams> Send for AsyncService<Request, Streams>where
Request: Send,
impl<Request, Streams> Sync for AsyncService<Request, Streams>
impl<Request, Streams> Unpin for AsyncService<Request, Streams>
impl<Request, Streams = ()> !UnwindSafe for AsyncService<Request, Streams>
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
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>
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>
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)
&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)
&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> 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>
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>
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 more