Struct heph_rt::RuntimeRef
source · [−]pub struct RuntimeRef { /* private fields */ }Expand description
A reference to a Runtime.
This reference refers to the thread-local runtime, and thus can’t be shared across thread bounds. To share this reference (within the same thread) it can be cloned.
Implementations
sourceimpl RuntimeRef
impl RuntimeRef
sourcepub fn try_spawn_local<S, NA>(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> Result<ActorRef<NA::Message>, NA::Error>where
S: Supervisor<NA> + 'static,
NA: NewActor<RuntimeAccess = ThreadLocal> + 'static,
NA::Actor: 'static,
pub fn try_spawn_local<S, NA>(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> Result<ActorRef<NA::Message>, NA::Error>where
S: Supervisor<NA> + 'static,
NA: NewActor<RuntimeAccess = ThreadLocal> + 'static,
NA::Actor: 'static,
Attempt to spawn a new thread-local actor.
See the Spawn trait for more information.
sourcepub fn spawn_local<S, NA>(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> ActorRef<NA::Message>where
S: Supervisor<NA> + 'static,
NA: NewActor<Error = !, RuntimeAccess = ThreadLocal> + 'static,
NA::Actor: 'static,
pub fn spawn_local<S, NA>(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> ActorRef<NA::Message>where
S: Supervisor<NA> + 'static,
NA: NewActor<Error = !, RuntimeAccess = ThreadLocal> + 'static,
NA::Actor: 'static,
Spawn a new thread-local actor.
See the Spawn trait for more information.
sourcepub fn try_spawn<S, NA>(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> Result<ActorRef<NA::Message>, NA::Error>where
S: Supervisor<NA> + Send + Sync + 'static,
NA: NewActor<RuntimeAccess = ThreadSafe> + Sync + Send + 'static,
NA::Actor: Send + Sync + 'static,
NA::Message: Send,
pub fn try_spawn<S, NA>(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> Result<ActorRef<NA::Message>, NA::Error>where
S: Supervisor<NA> + Send + Sync + 'static,
NA: NewActor<RuntimeAccess = ThreadSafe> + Sync + Send + 'static,
NA::Actor: Send + Sync + 'static,
NA::Message: Send,
Attempt to spawn a new thread-safe actor.
See the Spawn trait for more information.
sourcepub fn spawn<S, NA>(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> ActorRef<NA::Message>where
S: Supervisor<NA> + Send + Sync + 'static,
NA: NewActor<Error = !, RuntimeAccess = ThreadSafe> + Sync + Send + 'static,
NA::Actor: Send + Sync + 'static,
NA::Message: Send,
pub fn spawn<S, NA>(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> ActorRef<NA::Message>where
S: Supervisor<NA> + Send + Sync + 'static,
NA: NewActor<Error = !, RuntimeAccess = ThreadSafe> + Sync + Send + 'static,
NA::Actor: Send + Sync + 'static,
NA::Message: Send,
Spawn a new thread-safe actor.
See the Spawn trait for more information.
sourcepub fn spawn_local_future<Fut>(&mut self, future: Fut, options: FutureOptions)where
Fut: Future<Output = ()> + 'static,
pub fn spawn_local_future<Fut>(&mut self, future: Fut, options: FutureOptions)where
Fut: Future<Output = ()> + 'static,
sourcepub fn spawn_future<Fut>(&mut self, future: Fut, options: FutureOptions)where
Fut: Future<Output = ()> + Send + Sync + 'static,
pub fn spawn_future<Fut>(&mut self, future: Fut, options: FutureOptions)where
Fut: Future<Output = ()> + Send + Sync + 'static,
sourcepub fn receive_signals(&mut self, actor_ref: ActorRef<Signal>)
pub fn receive_signals(&mut self, actor_ref: ActorRef<Signal>)
Receive process signals as messages.
This adds the actor_ref to the list of actor references that will
receive a process signal.
Trait Implementations
sourceimpl Clone for RuntimeRef
impl Clone for RuntimeRef
sourcefn clone(&self) -> RuntimeRef
fn clone(&self) -> RuntimeRef
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for RuntimeRef
impl Debug for RuntimeRef
sourceimpl<S, NA> Spawn<S, NA, ThreadLocal> for RuntimeRefwhere
S: Supervisor<NA> + 'static,
NA: NewActor<RuntimeAccess = ThreadLocal> + 'static,
NA::Actor: 'static,
impl<S, NA> Spawn<S, NA, ThreadLocal> for RuntimeRefwhere
S: Supervisor<NA> + 'static,
NA: NewActor<RuntimeAccess = ThreadLocal> + 'static,
NA::Actor: 'static,
sourceimpl<S, NA> Spawn<S, NA, ThreadSafe> for RuntimeRefwhere
S: Supervisor<NA> + Send + Sync + 'static,
NA: NewActor<RuntimeAccess = ThreadSafe> + Send + Sync + 'static,
NA::Actor: Send + Sync + 'static,
NA::Message: Send,
impl<S, NA> Spawn<S, NA, ThreadSafe> for RuntimeRefwhere
S: Supervisor<NA> + Send + Sync + 'static,
NA: NewActor<RuntimeAccess = ThreadSafe> + Send + Sync + 'static,
NA::Actor: Send + Sync + 'static,
NA::Message: Send,
Auto Trait Implementations
impl !RefUnwindSafe for RuntimeRef
impl !Send for RuntimeRef
impl !Sync for RuntimeRef
impl Unpin for RuntimeRef
impl !UnwindSafe for RuntimeRef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more