[−][src]Struct actix_web_actors::HttpContext
Execution context for http actors
Methods
impl<A> HttpContext<A> where
A: Actor<Context = Self>,
[src]
A: Actor<Context = Self>,
pub fn create(actor: A) -> impl Stream<Item = Bytes, Error = Error>
[src]
Create a new HTTP Context from a request and an actor
pub fn with_factory<F>(f: F) -> impl Stream<Item = Bytes, Error = Error> where
F: FnOnce(&mut Self) -> A + 'static,
[src]
F: FnOnce(&mut Self) -> A + 'static,
Create a new HTTP Context
impl<A> HttpContext<A> where
A: Actor<Context = Self>,
[src]
A: Actor<Context = Self>,
pub fn write(&mut self, data: Bytes)
[src]
Write payload
pub fn write_eof(&mut self)
[src]
Indicate end of streaming payload. Also this method calls Self::close
.
pub fn handle(&self) -> SpawnHandle
[src]
Handle of the running future
SpawnHandle is the handle returned by AsyncContext::spawn()
method.
Trait Implementations
impl<A> ActorContext for HttpContext<A> where
A: Actor<Context = Self>,
[src]
A: Actor<Context = Self>,
impl<A> AsyncContext<A> for HttpContext<A> where
A: Actor<Context = Self>,
[src]
A: Actor<Context = Self>,
fn spawn<F>(&mut self, fut: F) -> SpawnHandle where
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
[src]
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
fn wait<F>(&mut self, fut: F) where
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
[src]
F: ActorFuture<Item = (), Error = (), Actor = A> + 'static,
fn cancel_future(&mut self, handle: SpawnHandle) -> bool
[src]
fn address(&self) -> Addr<A>
[src]
fn waiting(&self) -> bool
[src]
Checks if the context is paused (waiting for future completion or stopping).
fn add_stream<S>(&mut self, fut: S) -> SpawnHandle where
A: StreamHandler<<S as Stream>::Item, <S as Stream>::Error>,
S: Stream + 'static,
[src]
A: StreamHandler<<S as Stream>::Item, <S as Stream>::Error>,
S: Stream + 'static,
Registers a stream with the context. Read more
fn add_message_stream<S>(&mut self, fut: S) where
A: Handler<<S as Stream>::Item>,
S: Stream<Error = ()> + 'static,
<S as Stream>::Item: Message,
[src]
A: Handler<<S as Stream>::Item>,
S: Stream<Error = ()> + 'static,
<S as Stream>::Item: Message,
Registers a stream with the context, ignoring errors. Read more
fn notify<M>(&mut self, msg: M) where
A: Handler<M>,
M: Message + 'static,
[src]
A: Handler<M>,
M: Message + 'static,
Sends the message msg
to self. This bypasses the mailbox capacity, and will always queue the message. If the actor is in the stopped
state, an error will be raised. Read more
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,
Sends the message msg
to self after a specified period of time. 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,
Executes a closure after a specified period of time. Read more
fn run_interval<F>(&mut self, dur: Duration, f: F) -> SpawnHandle where
F: FnMut(&mut A, &mut <A as Actor>::Context) + 'static,
[src]
F: FnMut(&mut A, &mut <A as Actor>::Context) + 'static,
Spawns a job to execute the given closure periodically, at a specified fixed interval. Read more
impl<A, M> ToEnvelope<A, M> for HttpContext<A> where
A: Actor<Context = HttpContext<A>> + Handler<M>,
M: Message + Send + 'static,
M::Result: Send,
[src]
A: Actor<Context = HttpContext<A>> + Handler<M>,
M: Message + Send + 'static,
M::Result: Send,
impl<A> AsyncContextParts<A> for HttpContext<A> where
A: Actor<Context = Self>,
[src]
A: Actor<Context = Self>,
fn parts(&mut self) -> &mut ContextParts<A>
[src]
Auto Trait Implementations
impl<A> !Send for HttpContext<A>
impl<A> !Sync for HttpContext<A>
Blanket Implementations
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,