[−][src]Enum herbert::RouterCtl
A control message for the router.
These messages are processed directly by the router itself and control aspects of its
operation. Notably, the router is responsible for creating actors and their threads and must
receive a RouterCtl::Spawn
request to do so.
Variants
Create a new actor managed by the router.
Retrieve the request channel for an actor from the router.
Determine whether or not the router has an actor.
Stop an actor.
StopActorAsync(String)
Stop an actor without waiting for it to stop.
Stop all actors and then stop the router.
Methods
impl RouterCtl
[src]
pub fn spawn(id: &str, f: Box<ActorFn>) -> (Self, Receiver<()>)
[src]
Construct a RouterCtl::Spawn
request.
Returns the request object as well as a Receiver
over which the router will send
confirmation back to the requestor that the actor has been spawned.
The spawn_actor!
macro provides a more ergonomic wrapper around this method.
pub fn get(id: &str) -> (Self, Receiver<Result<Sender<Message>>>)
[src]
Construct a RouterCtl::Get
request.
Returns the request object as well as a Receiver
over which the router will send back to
the caller the Sender
for the given actor (or None
, if no such actor exists).
The get_actor!
macro provides a more ergonomic wrapper around this method.
pub fn has(id: &str) -> (Self, Receiver<bool>)
[src]
Construct a RouterCtl::Has
request.
Returns the request object as well as a Receiver
over which the router will send back a
boolean to the caller that indicates whether or not the given actor is available at the
time of its observation.
The has_actor!
macro provides a more ergonomic wrapper around this method.
pub fn stop_actor(id: &str) -> (Self, Receiver<()>)
[src]
Construct a RouterCtl::StopActor
request.
Returns the request object as well as a Receiver
over which the router will send
confirmation back to the caller that the actor has stopped.
pub fn stop_actor_async(id: &str) -> Self
[src]
Auto Trait Implementations
impl !RefUnwindSafe for RouterCtl
impl Send for RouterCtl
impl !Sync for RouterCtl
impl Unpin for RouterCtl
impl UnwindSafe for RouterCtl
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,