[−][src]Struct actix::Context
An actor execution context.
Methods
impl<A> Context<A> where
A: Actor<Context = Self>,
[src]
A: Actor<Context = Self>,
pub fn with_receiver(rx: AddressReceiver<A>) -> Self
[src]
pub fn run(self, act: A) -> Addr<A>
[src]
pub fn into_future(self, act: A) -> ContextFut<A, Self>
[src]
pub fn handle(&self) -> SpawnHandle
[src]
Returns a handle to the running future.
This is the handle returned by the AsyncContext::spawn()
method.
pub fn set_mailbox_capacity(&mut self, cap: usize)
[src]
Sets the mailbox capacity.
The default mailbox capacity is 16 messages. #Examples
struct MyActor; impl Actor for MyActor { type Context = Context<Self>; fn started(&mut self, ctx: &mut Self::Context) { ctx.set_mailbox_capacity(1); } } let addr = MyActor.start();
pub fn connected(&self) -> bool
[src]
Returns whether any addresses are still connected.
Trait Implementations
impl<A> ActorContext for Context<A> where
A: Actor<Context = Self>,
[src]
A: Actor<Context = Self>,
impl<A> AsyncContext<A> for Context<A> where
A: Actor<Context = Self>,
[src]
A: Actor<Context = Self>,
fn spawn<F>(&mut self, fut: F) -> SpawnHandle where
F: ActorFuture<Output = (), Actor = A> + 'static,
[src]
F: ActorFuture<Output = (), Actor = A> + 'static,
fn wait<F>(&mut self, fut: F) where
F: ActorFuture<Output = (), Actor = A> + 'static,
[src]
F: ActorFuture<Output = (), Actor = A> + 'static,
fn waiting(&self) -> bool
[src]
fn cancel_future(&mut self, handle: SpawnHandle) -> bool
[src]
fn address(&self) -> Addr<A>
[src]
fn add_stream<S>(&mut self, fut: S) -> SpawnHandle where
S: Stream + 'static,
A: StreamHandler<S::Item>,
[src]
S: Stream + 'static,
A: StreamHandler<S::Item>,
fn add_message_stream<S>(&mut self, fut: S) where
S: Stream + 'static,
S::Item: Message,
A: Handler<S::Item>,
[src]
S: Stream + 'static,
S::Item: Message,
A: Handler<S::Item>,
fn notify<M>(&mut self, msg: M) where
A: Handler<M>,
M: Message + 'static,
[src]
A: Handler<M>,
M: Message + 'static,
fn notify_later<M>(&mut self, msg: M, after: Duration) -> SpawnHandle where
A: Handler<M>,
M: Message + 'static,
[src]
A: Handler<M>,
M: Message + 'static,
fn run_later<F>(&mut self, dur: Duration, f: F) -> SpawnHandle where
F: FnOnce(&mut A, &mut A::Context) + 'static,
[src]
F: FnOnce(&mut A, &mut A::Context) + 'static,
fn run_interval<F>(&mut self, dur: Duration, f: F) -> SpawnHandle where
F: FnMut(&mut A, &mut A::Context) + 'static,
[src]
F: FnMut(&mut A, &mut A::Context) + 'static,
impl<A> AsyncContextParts<A> for Context<A> where
A: Actor<Context = Self>,
[src]
A: Actor<Context = Self>,
fn parts(&mut self) -> &mut ContextParts<A>
[src]
impl<A: Actor<Context = Context<A>>> Debug for Context<A>
[src]
impl<A, M> ToEnvelope<A, M> for Context<A> where
A: Actor<Context = Context<A>> + Handler<M>,
M: Message + Send + 'static,
M::Result: Send,
[src]
A: Actor<Context = Context<A>> + Handler<M>,
M: Message + Send + 'static,
M::Result: Send,
Auto Trait Implementations
impl<A> !RefUnwindSafe for Context<A>
impl<A> !Send for Context<A>
impl<A> !Sync for Context<A>
impl<A> Unpin for Context<A>
impl<A> !UnwindSafe for Context<A>
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,
ⓘImportant traits for &'_ mut Ffn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut F
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,