RootlessBackend

Trait RootlessBackend 

Source
pub trait RootlessBackend<T>
where T: RootlessOptions,
{ type Err; // Required methods fn new(options: T) -> Self where Self: Sized; fn options(&self) -> &T; fn run(&self, command: &[&str]) -> Result<Output, Self::Err>; }
Expand description

A backend for running a command as root.

Required Associated Types§

Source

type Err

The Error type to use.

Required Methods§

Source

fn new(options: T) -> Self
where Self: Sized,

Creates a new RootlessBackend from a RootlessOptions.

Source

fn options(&self) -> &T

Returns the specific RootlessOptions used for the RootlessBackend implementation.

Source

fn run(&self, command: &[&str]) -> Result<Output, Self::Err>

Runs a command as root using the RootlessBackend implementation and returns the resulting Output.

Implementors§