Trait cargo_tarpaulin::statemachine::StateData
source · [−]pub trait StateData {
fn start(&mut self) -> Result<Option<TestState>, RunError>;
fn init(&mut self) -> Result<TestState, RunError>;
fn wait(&mut self) -> Result<Option<TestState>, RunError>;
fn last_wait_attempt(&mut self) -> Result<Option<TestState>, RunError>;
fn stop(&mut self) -> Result<TestState, RunError>;
}
Expand description
Tracing a process on an OS will have platform specific code. Structs containing the platform specific datastructures should provide this trait with an implementation of the handling of the given states.
Required Methods
Starts the tracing. Returns None while waiting for start. Statemachine then checks timeout
Initialises test for tracing returns next state
Waits for notification from test executable that there’s something to do. Selects the next appropriate state if there’s something to do otherwise None
This is here for the times when we’re about to mark the attempted coverage collection as a failure i.e. timeout, but there’s an alternative to that which can see if we’re actually in a “finished” state but are still waiting on resource cleanup so we don’t lose the results.
Trait Implementations
sourceimpl<'a> StateData for Box<dyn StateData + 'a>
impl<'a> StateData for Box<dyn StateData + 'a>
sourcefn start(&mut self) -> Result<Option<TestState>, RunError>
fn start(&mut self) -> Result<Option<TestState>, RunError>
Starts the tracing. Returns None while waiting for start. Statemachine then checks timeout Read more
sourcefn init(&mut self) -> Result<TestState, RunError>
fn init(&mut self) -> Result<TestState, RunError>
Initialises test for tracing returns next state
sourcefn wait(&mut self) -> Result<Option<TestState>, RunError>
fn wait(&mut self) -> Result<Option<TestState>, RunError>
Waits for notification from test executable that there’s something to do. Selects the next appropriate state if there’s something to do otherwise None Read more
sourcefn last_wait_attempt(&mut self) -> Result<Option<TestState>, RunError>
fn last_wait_attempt(&mut self) -> Result<Option<TestState>, RunError>
This is here for the times when we’re about to mark the attempted coverage collection as a failure i.e. timeout, but there’s an alternative to that which can see if we’re actually in a “finished” state but are still waiting on resource cleanup so we don’t lose the results. Read more