Struct actix::actors::mocker::Mocker [−][src]
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.
Implementations
impl<T: Unpin> 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 + Unpin + 'static> Actor for Mocker<T>
[src]
type Context = Context<Self>
Actor execution context type
fn started(&mut self, ctx: &mut Self::Context)
[src]
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
[src]
fn stopped(&mut self, ctx: &mut Self::Context)
[src]
fn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
[src]
Self: Actor<Context = Context<Self>>,
fn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
[src]
Self: Actor<Context = Context<Self>> + Default,
fn start_in_arbiter<F>(wrk: &ArbiterHandle, 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,
fn create<F>(f: F) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
F: FnOnce(&mut Context<Self>) -> Self,
[src]
Self: Actor<Context = Context<Self>>,
F: FnOnce(&mut Context<Self>) -> Self,
impl<T: ArbiterService> ArbiterService for Mocker<T>
[src]
fn start_service() -> Addr<Self>
[src]
fn service_started(&mut self, ctx: &mut Context<Self>)
[src]
fn from_registry() -> Addr<Self>
[src]
impl<T: Unpin> Default for Mocker<T>
[src]
impl<M: 'static, T: Sized + Unpin + '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. Read more
fn handle(&mut self, msg: M, ctx: &mut Self::Context) -> M::Result
[src]
impl<T: Unpin> Supervised for Mocker<T>
[src]
fn restarting(&mut self, ctx: &mut Self::Context)
[src]
impl<T: SystemService> SystemService for Mocker<T>
[src]
fn start_service(wrk: &ArbiterHandle) -> Addr<Self>
[src]
fn service_started(&mut self, ctx: &mut Context<Self>)
[src]
fn from_registry() -> Addr<Self>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Mocker<T>
impl<T> !Send for Mocker<T>
impl<T> !Sync for Mocker<T>
impl<T> Unpin for Mocker<T>
impl<T> !UnwindSafe for Mocker<T>
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,
pub fn borrow_mut(&mut self) -> &mut Tⓘ
[src]
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.
pub 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>,