Struct actix_web::HttpContext [−][src]
Execution context for http actors
Methods
impl<A, S: 'static> HttpContext<A, S> where
A: Actor<Context = Self>,
[src]
[−]
impl<A, S: 'static> HttpContext<A, S> where
A: Actor<Context = Self>,
pub fn create(req: HttpRequest<S>, actor: A) -> Body
[src]
[−]
pub fn create(req: HttpRequest<S>, actor: A) -> Body
Create a new HTTP Context from a request and an actor
pub fn with_factory<F>(req: HttpRequest<S>, f: F) -> Body where
F: FnOnce(&mut Self) -> A + 'static,
[src]
[−]
pub fn with_factory<F>(req: HttpRequest<S>, f: F) -> Body where
F: FnOnce(&mut Self) -> A + 'static,
Create a new HTTP Context
impl<A, S> HttpContext<A, S> where
A: Actor<Context = Self>,
[src]
[−]
impl<A, S> HttpContext<A, S> where
A: Actor<Context = Self>,
ⓘImportant traits for &'a mut Rpub fn state(&self) -> &S
[src]
[−]
ⓘImportant traits for &'a mut R
pub fn state(&self) -> &S
Shared application state
pub fn request(&mut self) -> &mut HttpRequest<S>
[src]
[−]
pub fn request(&mut self) -> &mut HttpRequest<S>
Incoming request
pub fn write<B: Into<Binary>>(&mut self, data: B)
[src]
[−]
pub fn write<B: Into<Binary>>(&mut self, data: B)
Write payload
pub fn write_eof(&mut self)
[src]
[−]
pub fn write_eof(&mut self)
Indicate end of streaming payload. Also this method calls Self::close
.
pub fn drain(&mut self) -> Drain<A>
[src]
[−]
pub fn drain(&mut self) -> Drain<A>
Returns drain future
pub fn connected(&self) -> bool
[src]
[−]
pub fn connected(&self) -> bool
Check if connection still open
pub fn handle(&self) -> SpawnHandle
[src]
[−]
pub fn handle(&self) -> SpawnHandle
Handle of the running future
SpawnHandle is the handle returned by AsyncContext::spawn()
method.
Trait Implementations
impl<A, S> ActorContext for HttpContext<A, S> where
A: Actor<Context = Self>,
[src]
[+]
impl<A, S> ActorContext for HttpContext<A, S> where
A: Actor<Context = Self>,
impl<A, S> AsyncContext<A> for HttpContext<A, S> where
A: Actor<Context = Self>,
[src]
[+]
impl<A, S> AsyncContext<A> for HttpContext<A, S> where
A: Actor<Context = Self>,
impl<A, S> AsyncContextParts<A> for HttpContext<A, S> where
A: Actor<Context = Self>,
[src]
[+]
impl<A, S> AsyncContextParts<A> for HttpContext<A, S> where
A: Actor<Context = Self>,
impl<A, M, S> ToEnvelope<A, M> for HttpContext<A, S> where
A: Actor<Context = HttpContext<A, S>> + Handler<M>,
M: Message + Send + 'static,
M::Result: Send,
[src]
[+]
impl<A, M, S> ToEnvelope<A, M> for HttpContext<A, S> where
A: Actor<Context = HttpContext<A, S>> + Handler<M>,
M: Message + Send + 'static,
M::Result: Send,
Auto Trait Implementations
impl<A, S = ()> !Send for HttpContext<A, S>
impl<A, S = ()> !Send for HttpContext<A, S>
impl<A, S = ()> !Sync for HttpContext<A, S>
impl<A, S = ()> !Sync for HttpContext<A, S>