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 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for RuntimeRef
impl Debug for RuntimeRef
sourceimpl<S, NA> Spawn<S, NA, ThreadLocal> for RuntimeRef where
S: Supervisor<NA> + 'static,
NA: NewActor<RuntimeAccess = ThreadLocal> + 'static,
NA::Actor: 'static,
impl<S, NA> Spawn<S, NA, ThreadLocal> for RuntimeRef where
S: Supervisor<NA> + 'static,
NA: NewActor<RuntimeAccess = ThreadLocal> + 'static,
NA::Actor: 'static,
sourcefn try_spawn(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> Result<ActorRef<NA::Message>, NA::Error> where
S: Supervisor<NA>,
NA: NewActor<RuntimeAccess = RT>,
fn try_spawn(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> Result<ActorRef<NA::Message>, NA::Error> where
S: Supervisor<NA>,
NA: NewActor<RuntimeAccess = RT>,
Attempts to spawn an actor. Read more
sourcefn spawn(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> ActorRef<NA::Message> where
S: Supervisor<NA>,
NA: NewActor<Error = !, RuntimeAccess = RT>,
fn spawn(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> ActorRef<NA::Message> where
S: Supervisor<NA>,
NA: NewActor<Error = !, RuntimeAccess = RT>,
Spawn an actor. Read more
sourceimpl<S, NA> Spawn<S, NA, ThreadSafe> for RuntimeRef where
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 RuntimeRef where
S: Supervisor<NA> + Send + Sync + 'static,
NA: NewActor<RuntimeAccess = ThreadSafe> + Send + Sync + 'static,
NA::Actor: Send + Sync + 'static,
NA::Message: Send,
sourcefn try_spawn(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> Result<ActorRef<NA::Message>, NA::Error> where
S: Supervisor<NA>,
NA: NewActor<RuntimeAccess = RT>,
fn try_spawn(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> Result<ActorRef<NA::Message>, NA::Error> where
S: Supervisor<NA>,
NA: NewActor<RuntimeAccess = RT>,
Attempts to spawn an actor. Read more
sourcefn spawn(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> ActorRef<NA::Message> where
S: Supervisor<NA>,
NA: NewActor<Error = !, RuntimeAccess = RT>,
fn spawn(
&mut self,
supervisor: S,
new_actor: NA,
arg: NA::Argument,
options: ActorOptions
) -> ActorRef<NA::Message> where
S: Supervisor<NA>,
NA: NewActor<Error = !, RuntimeAccess = RT>,
Spawn an actor. Read more
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more