Struct heph::actor_ref::ActorGroup [−][src]
pub struct ActorGroup<M> { /* fields omitted */ }
Expand description
A group of ActorRef
s used to send a message to multiple actors.
Implementations
Creates an empty ActorGroup
.
Create a new ActorGroup
.
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_send
ing 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.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
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