pub struct MockSupervisorSource { /* private fields */ }Expand description
In-memory SupervisorSource used by tests and the M2
CLI’s own “no daemon yet” path. Tracks daemon state as a
boolean and reports a stubbed socket path on Start /
Status so the dispatcher copy has something concrete to
print.
Implementations§
Source§impl MockSupervisorSource
impl MockSupervisorSource
pub fn new(running: bool) -> Self
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Observed running-state. Handy for assertions.
Sourcepub fn socket_torn_down(&self) -> bool
pub fn socket_torn_down(&self) -> bool
Did any prior call tear down the socket? Lets
/kill-compound tests assert the behavior happened
without exposing internal state on every reply.
Trait Implementations§
Source§impl Debug for MockSupervisorSource
impl Debug for MockSupervisorSource
Source§impl Default for MockSupervisorSource
impl Default for MockSupervisorSource
Source§impl SupervisorSource for MockSupervisorSource
impl SupervisorSource for MockSupervisorSource
Source§fn act(
&self,
action: SupervisorAction,
) -> Result<SupervisorReply, SupervisorError>
fn act( &self, action: SupervisorAction, ) -> Result<SupervisorReply, SupervisorError>
Issue an action to the supervisor. Read more
Source§fn tear_down_socket(&self) -> Result<bool, SupervisorError>
fn tear_down_socket(&self) -> Result<bool, SupervisorError>
Tear down the daemon’s listener socket as part of a
/kill. Idempotent: when the daemon is already stopped
this returns Ok(false) and the dispatch layer treats
that as “no tear-down needed”. When it did tear one
down, returns Ok(true) so the /kill line can tag
the compound behavior. Read moreAuto Trait Implementations§
impl !Freeze for MockSupervisorSource
impl RefUnwindSafe for MockSupervisorSource
impl Send for MockSupervisorSource
impl Sync for MockSupervisorSource
impl Unpin for MockSupervisorSource
impl UnsafeUnpin for MockSupervisorSource
impl UnwindSafe for MockSupervisorSource
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