#[non_exhaustive]pub struct AsyncService<Request, Streams: StreamPack = ()> {
pub request: Request,
pub streams: Streams::StreamChannels,
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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.request: RequestThe input data of the request
streams: Streams::StreamChannelsStream channels that will let you send stream information. This will
usually be a StreamChannel or a (possibly nested) tuple of
StreamChannels, whichever matches the StreamPack description.
channel: ChannelThe channel that allows querying and syncing with the world while the service runs asynchronously.
provider: EntityThe entity providing the service
source: EntityThe node in a workflow or series that asked for the service
session: EntityThe 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
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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
Converts
&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)
Converts
&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> DowncastSend for T
impl<T> DowncastSend for T
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>
Converts
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>
Converts
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