Trait pacaptr::pm::PmHelper

source ·
pub trait PmHelper: Pm {
    // Provided methods
    fn check_output<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cmd: Cmd,
        mode: PmMode,
        strat: &'life1 Strategy
    ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn run_with<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cmd: Cmd,
        mode: PmMode,
        strat: &'life1 Strategy
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn run<'life0, 'async_trait>(
        &'life0 self,
        cmd: Cmd
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn search_regex<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        cmd: Cmd,
        patterns: &'life1 [&'life2 str]
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn search_regex_with_header<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        cmd: Cmd,
        patterns: &'life1 [&'life2 str],
        header_lines: usize
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Extra implementation helper functions for Pm, focusing on the ability to run commands (Cmds) in a configured and Pm-specific context.

Provided Methods§

source

fn check_output<'life0, 'life1, 'async_trait>( &'life0 self, cmd: Cmd, mode: PmMode, strat: &'life1 Strategy ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes a command in the context of the Pm implementation. Returns the Output of this command.

source

fn run_with<'life0, 'life1, 'async_trait>( &'life0 self, cmd: Cmd, mode: PmMode, strat: &'life1 Strategy ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes a command in the context of the Pm implementation, with custom PmMode and Strategy.

source

fn run<'life0, 'async_trait>( &'life0 self, cmd: Cmd ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Executes a command in the context of the Pm implementation with default settings.

source

fn search_regex<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, cmd: Cmd, patterns: &'life1 [&'life2 str] ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Executes a command in PmMode::Mute and prints the output lines that match against the given regex patterns.

source

fn search_regex_with_header<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, cmd: Cmd, patterns: &'life1 [&'life2 str], header_lines: usize ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Executes a command in PmMode::Mute and prints header_lines of header followed by the output lines that match against the given regex patterns. If header_lines >= text.lines().count(), then the output lines are printed without changes.

Implementors§

source§

impl<P: Pm> PmHelper for P