pub struct Mocker<T: Sized + Unpin + 'static> { /* private fields */ }
Expand description
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§
Trait Implementations§
Source§impl<T: Sized + Unpin + 'static> Actor for Mocker<T>
impl<T: Sized + Unpin + 'static> Actor for Mocker<T>
Source§fn started(&mut self, ctx: &mut Self::Context)
fn started(&mut self, ctx: &mut Self::Context)
Called when an actor gets polled the first time.
Source§fn stopping(&mut self, ctx: &mut Self::Context) -> Running
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
Called after an actor is in
Actor::Stopping
state. Read moreSource§fn start_default() -> Addr<Self>
fn start_default() -> Addr<Self>
Construct and start a new asynchronous actor, returning its
address. Read more
Source§fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
Start new actor in arbiter’s thread.
Source§impl<T: ArbiterService> ArbiterService for Mocker<T>
impl<T: ArbiterService> ArbiterService for Mocker<T>
Source§fn start_service() -> Addr<Self>
fn start_service() -> Addr<Self>
Construct and start arbiter service
Source§fn service_started(&mut self, ctx: &mut Context<Self>)
fn service_started(&mut self, ctx: &mut Context<Self>)
Method is called during service initialization.
Source§fn from_registry() -> Addr<Self>
fn from_registry() -> Addr<Self>
Get actor’s address from arbiter registry
Source§impl<T: Unpin> Supervised for Mocker<T>
impl<T: Unpin> Supervised for Mocker<T>
Source§fn restarting(&mut self, ctx: &mut <Self as Actor>::Context)
fn restarting(&mut self, ctx: &mut <Self as Actor>::Context)
Called when the supervisor restarts a failed actor.
Source§impl<T: SystemService> SystemService for Mocker<T>
impl<T: SystemService> SystemService for Mocker<T>
Source§fn start_service(wrk: &ArbiterHandle) -> Addr<Self>
fn start_service(wrk: &ArbiterHandle) -> Addr<Self>
Construct and start system service
Source§fn service_started(&mut self, ctx: &mut Context<Self>)
fn service_started(&mut self, ctx: &mut Context<Self>)
Method is called during service initialization.
Source§fn from_registry() -> Addr<Self>
fn from_registry() -> Addr<Self>
Get actor’s address from system registry
Auto Trait Implementations§
impl<T> Freeze for Mocker<T>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more