[−][src]Struct actix::actors::mocker::Mocker
This actor is able to wrap another actor and accept all the messages the wrapped actor can, passing it to a closure which can mock the response of the actor.
Methods
impl<T> Mocker<T>
[src]
pub fn mock(
mock: Box<dyn FnMut(Box<dyn Any>, &mut Context<Mocker<T>>) -> Box<dyn Any>>
) -> Mocker<T>
[src]
mock: Box<dyn FnMut(Box<dyn Any>, &mut Context<Mocker<T>>) -> Box<dyn Any>>
) -> Mocker<T>
Trait Implementations
impl<T: Sized + 'static> Actor for Mocker<T>
[src]
type Context = Context<Self>
Actor execution context type
fn started(&mut self, ctx: &mut Self::Context)
[src]
Called when an actor gets polled the first time.
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
[src]
Called after an actor is in Actor::Stopping
state. Read more
fn stopped(&mut self, ctx: &mut Self::Context)
[src]
Called after an actor is stopped. Read more
fn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
[src]
Self: Actor<Context = Context<Self>>,
Start a new asynchronous actor, returning its address. Read more
fn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
[src]
Self: Actor<Context = Context<Self>> + Default,
Construct and start a new asynchronous actor, returning its address. Read more
fn start_in_arbiter<F>(arb: &Arbiter, f: F) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
F: FnOnce(&mut Context<Self>) -> Self + Send + 'static,
[src]
Self: Actor<Context = Context<Self>>,
F: FnOnce(&mut Context<Self>) -> Self + Send + 'static,
Start new actor in arbiter's thread.
fn create<F>(f: F) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
F: FnOnce(&mut Context<Self>) -> Self + 'static,
[src]
Self: Actor<Context = Context<Self>>,
F: FnOnce(&mut Context<Self>) -> Self + 'static,
Start a new asynchronous actor given a Context
. Read more
impl<T> Supervised for Mocker<T>
[src]
fn restarting(&mut self, ctx: &mut Self::Context)
[src]
Called when the supervisor restarts a failed actor.
impl<M: 'static, T: Sized + 'static> Handler<M> for Mocker<T> where
M: Message,
<M as Message>::Result: MessageResponse<Mocker<T>, M>,
[src]
M: Message,
<M as Message>::Result: MessageResponse<Mocker<T>, M>,
type Result = M::Result
The type of value that this handler will return.
fn handle(&mut self, msg: M, ctx: &mut Self::Context) -> M::Result
[src]
impl<T: ArbiterService> ArbiterService for Mocker<T>
[src]
fn start_service() -> Addr<Self>
[src]
Construct and start arbiter service
fn service_started(&mut self, ctx: &mut Context<Self>)
[src]
Method is called during service initialization.
fn from_registry() -> Addr<Self>
[src]
Get actor's address from arbiter registry
impl<T: SystemService> SystemService for Mocker<T>
[src]
fn start_service(sys: &Arbiter) -> Addr<Self>
[src]
Construct and start system service
fn service_started(&mut self, ctx: &mut Context<Self>)
[src]
Method is called during service initialization.
fn from_registry() -> Addr<Self>
[src]
Get actor's address from system registry
impl<T> Default for Mocker<T>
[src]
Auto Trait Implementations
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,