Struct heph::actor_ref::ActorGroup[][src]

pub struct ActorGroup<M> { /* fields omitted */ }
Expand description

A group of ActorRefs used to send a message to multiple actors.

Implementations

Creates an empty ActorGroup.

Create a new ActorGroup.

Returns the number of actor references in the group.

Returns true if the group is empty.

Add an ActorRef to the group.

Add an ActorRef to the group, iff it’s not already in the group.

Remove all actor references which point to the same actor as actor_ref.

Remove all actor references that have been disconnected.

Make the group of actor references unique.

Removes all duplicate actor references.

Attempts to send a message to all the actors in the group.

This can either send the message to a single actor, by using Delivery::ToOne, or to all actors in the group by using Delivery::ToAll.

When deliverying to all actors this will first clone the message and then try_sending it to each actor in the group. Note that this means it will clone before calling Into::into on the message. If the call to Into::into is expansive, or M is cheaper to clone than Msg it might be worthwhile to call msg.into() before calling this method.

This only returns an error if the group is empty, otherwise this will always return Ok(()).

See Sending messages for more details.

Wait for all actors in this group to finish running.

This works the same way as ActorRef::join, but waits on a group of actors.

Trait Implementations

Formats the value using the given formatter. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Performs the conversion.

Creates a value from an iterator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.