Skip to main content

ActorSpawnerEndpoint

Trait ActorSpawnerEndpoint 

Source
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§

Source

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>,

Spawn a registered actor with a fresh actor uid.

Source

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>,

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.

Source

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>,

Spawn a registered actor with an explicit actor uid.

Source

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>,

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.

Spawn a registered actor with an explicit actor uid and liveness link.

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".

Implementors§