pub trait ActorSpawnerEndpoint {
// Provided methods
fn spawn<A>(
&self,
cx: &impl Actor,
params: A::Params,
) -> Result<ActorRef<A>>
where A: RemoteSpawn,
Self: Clone + Send + 'static,
for<'a> &'a Self: Endpoint<SpawnActorMessage> { ... }
fn spawn_with_handle<A>(
&self,
cx: &impl Actor,
params: A::Params,
) -> Result<(ActorRef<A>, ActorHandle<Supervisor>)>
where A: RemoteSpawn,
Self: Clone + Send + 'static,
for<'a> &'a Self: Endpoint<SpawnActorMessage> { ... }
fn spawn_uid<A>(
&self,
cx: &impl Actor,
uid: Uid,
params: A::Params,
) -> Result<ActorRef<A>>
where A: RemoteSpawn,
Self: Clone + Send + 'static,
for<'a> &'a Self: Endpoint<SpawnActorMessage> { ... }
fn spawn_uid_with_ready<A>(
&self,
cx: &impl Actor,
uid: Uid,
params: A::Params,
ready: OncePortHandle<()>,
) -> Result<ActorRef<A>>
where A: RemoteSpawn,
Self: Clone + Send + 'static,
for<'a> &'a Self: Endpoint<SpawnActorMessage> { ... }
fn spawn_uid_with_link<A>(
&self,
cx: &impl Actor,
uid: Uid,
params: A::Params,
liveness: KeepaliveLink,
) -> Result<ActorRef<A>>
where A: RemoteSpawn,
Self: Clone + Send + 'static,
for<'a> &'a Self: Endpoint<SpawnActorMessage> { ... }
fn spawn_uid_with_link_and_ready<A>(
&self,
cx: &impl Actor,
uid: Uid,
params: A::Params,
liveness: KeepaliveLink,
ready: Option<OncePortHandle<()>>,
environment: ActorEnvironment,
labels: Flattrs,
) -> Result<(ActorRef<A>, ActorHandle<Supervisor>)>
where A: RemoteSpawn,
Self: Clone + Send + 'static,
for<'a> &'a Self: Endpoint<SpawnActorMessage> { ... }
}Expand description
Convenience methods for endpoints that accept SpawnActor requests.
Provided Methods§
Sourcefn spawn<A>(&self, cx: &impl Actor, params: A::Params) -> Result<ActorRef<A>>
fn spawn<A>(&self, cx: &impl Actor, params: A::Params) -> Result<ActorRef<A>>
Spawn a registered actor with a fresh actor uid.
Sourcefn spawn_with_handle<A>(
&self,
cx: &impl Actor,
params: A::Params,
) -> Result<(ActorRef<A>, ActorHandle<Supervisor>)>
fn spawn_with_handle<A>( &self, cx: &impl Actor, params: A::Params, ) -> Result<(ActorRef<A>, ActorHandle<Supervisor>)>
Spawn a registered actor and return its local supervisor handle.
The returned actor ref identifies the eventual remote actor. The handle controls its local supervisor proxy and can be stopped immediately, including before the remote supervision session links.
Sourcefn spawn_uid<A>(
&self,
cx: &impl Actor,
uid: Uid,
params: A::Params,
) -> Result<ActorRef<A>>
fn spawn_uid<A>( &self, cx: &impl Actor, uid: Uid, params: A::Params, ) -> Result<ActorRef<A>>
Spawn a registered actor with an explicit actor uid.
Sourcefn spawn_uid_with_ready<A>(
&self,
cx: &impl Actor,
uid: Uid,
params: A::Params,
ready: OncePortHandle<()>,
) -> Result<ActorRef<A>>
fn spawn_uid_with_ready<A>( &self, cx: &impl Actor, uid: Uid, params: A::Params, ready: OncePortHandle<()>, ) -> Result<ActorRef<A>>
Spawn a registered actor and report when it has linked.
The returned ActorRef is usable immediately; see the
module docs. A bare readiness signal is posted to ready once
the actor has linked. The address is already known from the
synchronously returned ActorRef, so ready carries no payload.
Sourcefn spawn_uid_with_link<A>(
&self,
cx: &impl Actor,
uid: Uid,
params: A::Params,
liveness: KeepaliveLink,
) -> Result<ActorRef<A>>
fn spawn_uid_with_link<A>( &self, cx: &impl Actor, uid: Uid, params: A::Params, liveness: KeepaliveLink, ) -> Result<ActorRef<A>>
Spawn a registered actor with an explicit actor uid and liveness link.
Sourcefn spawn_uid_with_link_and_ready<A>(
&self,
cx: &impl Actor,
uid: Uid,
params: A::Params,
liveness: KeepaliveLink,
ready: Option<OncePortHandle<()>>,
environment: ActorEnvironment,
labels: Flattrs,
) -> Result<(ActorRef<A>, ActorHandle<Supervisor>)>
fn spawn_uid_with_link_and_ready<A>( &self, cx: &impl Actor, uid: Uid, params: A::Params, liveness: KeepaliveLink, ready: Option<OncePortHandle<()>>, environment: ActorEnvironment, labels: Flattrs, ) -> Result<(ActorRef<A>, ActorHandle<Supervisor>)>
Spawn a registered actor with an explicit actor uid, liveness link,
optional readiness port, persistent environment, and supervision event
labels. This is the general form behind the other spawn* methods,
which pass the caller’s own environment and no labels; see
spawn_uid_with_ready for the readiness
semantics and Supervisor::with_labels for the labels.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".