Struct actix_web::dev::HttpContext
[−]
[src]
pub struct HttpContext<A> where
A: Actor<Context = HttpContext<A>> + Route, { /* fields omitted */ }
Actor execution context
Methods
impl<A> HttpContext<A> where
A: Actor<Context = Self> + Route,
[src]
A: Actor<Context = Self> + Route,
impl<A> HttpContext<A> where
A: Actor<Context = Self> + Route,
[src]
A: Actor<Context = Self> + Route,
fn state(&self) -> &<A as Route>::State
[src]
Shared application state
fn start<R: Into<HttpResponse>>(&mut self, response: R)
[src]
Start response processing
fn write<B: Into<Bytes>>(&mut self, data: B)
[src]
Write payload
fn write_eof(&mut self)
[src]
Indicate end of streamimng payload
Trait Implementations
impl<A> ActorContext<A> for HttpContext<A> where
A: Actor<Context = Self> + Route,
[src]
A: Actor<Context = Self> + Route,
fn stop(&mut self)
[src]
Stop actor execution
fn terminate(&mut self)
[src]
Terminate actor execution
fn state(&self) -> ActorState
[src]
Actor execution state
fn alive(&self) -> bool
[src]
Check if execution context is alive
fn address<Address>(&mut self) -> Address where
A: ActorAddress<A, Address>,
[src]
A: ActorAddress<A, Address>,
Get actor address
impl<A> AsyncContext<A> for HttpContext<A> where
A: Actor<Context = Self> + Route,
[src]
A: Actor<Context = Self> + Route,
fn spawn<F>(&mut self, fut: F) -> SpawnHandle where
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
[src]
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
Spawn async future into context. Returns handle of the item, could be used for cancelling execution. Read more
fn wait<F>(&mut self, fut: F) where
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
[src]
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
Spawn future into the context. Stop processing any of incoming events until this future resolves. Read more
fn cancel_future(&mut self, handle: SpawnHandle) -> bool
[src]
Cancel future. idx is a value returned by spawn
method.
fn add_future<F>(&mut self, fut: F) where
A: Handler<<F as Future>::Item, <F as Future>::Error>,
F: Future + 'static,
<F as Future>::Item: ResponseType,
[src]
A: Handler<<F as Future>::Item, <F as Future>::Error>,
F: Future + 'static,
<F as Future>::Item: ResponseType,
This method allow to handle Future in similar way as normal actor messages. Read more
fn add_stream<S>(&mut self, fut: S) where
A: Handler<<S as Stream>::Item, <S as Stream>::Error> + StreamHandler<<S as Stream>::Item, <S as Stream>::Error>,
S: Stream + 'static,
<S as Stream>::Item: ResponseType,
[src]
A: Handler<<S as Stream>::Item, <S as Stream>::Error> + StreamHandler<<S as Stream>::Item, <S as Stream>::Error>,
S: Stream + 'static,
<S as Stream>::Item: ResponseType,
This method is similar to add_future
but works with streams. Read more
fn notify<M, E>(&mut self, msg: M, after: Duration) -> SpawnHandle where
A: Handler<M, E>,
E: 'static,
M: ResponseType + 'static,
[src]
A: Handler<M, E>,
E: 'static,
M: ResponseType + 'static,
Send message msg
to self after specified period of time. Returns spawn handle which could be used for cancelation. Read more
fn run_later<F>(&mut self, dur: Duration, f: F) -> SpawnHandle where
F: FnOnce(&mut A, &mut <A as Actor>::Context) -> () + 'static,
[src]
F: FnOnce(&mut A, &mut <A as Actor>::Context) -> () + 'static,
Execute closure after specified period of time within same Actor and Context
impl<A, M> ToEnvelope<A, M> for HttpContext<A> where
A: Actor<Context = HttpContext<A>> + Route + Handler<M>,
M: ResponseType + Send + 'static,
M::Item: Send,
M::Error: Send,
[src]
A: Actor<Context = HttpContext<A>> + Route + Handler<M>,
M: ResponseType + Send + 'static,
M::Item: Send,
M::Error: Send,