pub struct BinProcess { /* private fields */ }Implementations§
Source§impl BinProcess
impl BinProcess
Sourcepub fn pid(&self) -> i32
pub fn pid(&self) -> i32
Return the PID of
TODO: when nix crate is 1.0 this method should return a nix::unistd::Pid instead of an i32
Sourcepub fn send_sigterm(&self)
pub fn send_sigterm(&self)
Send SIGTERM to the process
TODO: This will be replaced with a send_signal method when nix crate is 1.0
Sourcepub fn send_sigint(&self)
pub fn send_sigint(&self)
Send SIGINT to the process
TODO: This will be replaced with a send_signal method when nix crate is 1.0
Sourcepub async fn wait_for(
&mut self,
ready: &EventMatcher,
expected_errors_and_warnings: &[EventMatcher],
) -> Events
pub async fn wait_for( &mut self, ready: &EventMatcher, expected_errors_and_warnings: &[EventMatcher], ) -> Events
Waits for the ready EventMatcher to match on an incoming event.
All events that were encountered while waiting are returned.
Sourcepub async fn consume_events(
&mut self,
event_count: usize,
expected_errors_and_warnings: &[EventMatcher],
) -> Events
pub async fn consume_events( &mut self, event_count: usize, expected_errors_and_warnings: &[EventMatcher], ) -> Events
Await event_count messages to be emitted from the process.
The emitted events are returned.
Sourcepub async fn shutdown_and_then_consume_events(
self,
expected_errors_and_warnings: &[EventMatcher],
) -> Events
pub async fn shutdown_and_then_consume_events( self, expected_errors_and_warnings: &[EventMatcher], ) -> Events
Issues SIGTERM to the process and then awaits its shutdown. All remaining events will be returned.
Sourcepub async fn consume_remaining_events(
self,
expected_errors_and_warnings: &[EventMatcher],
) -> Events
pub async fn consume_remaining_events( self, expected_errors_and_warnings: &[EventMatcher], ) -> Events
prefer shutdown_and_then_consume_events.
This method will not return until the process has terminated.
It is useful when you need to test a shutdown method other than SIGTERM.
Sourcepub async fn consume_remaining_events_expect_failure(
self,
expected_errors_and_warnings: &[EventMatcher],
) -> Events
pub async fn consume_remaining_events_expect_failure( self, expected_errors_and_warnings: &[EventMatcher], ) -> Events
Identical to consume_remaining_events but asserts that the process exited with failure code instead of success
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BinProcess
impl !RefUnwindSafe for BinProcess
impl Send for BinProcess
impl Sync for BinProcess
impl Unpin for BinProcess
impl !UnwindSafe for BinProcess
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more