Skip to main content

DryRun

Struct DryRun 

Source
pub struct DryRun { /* private fields */ }
Expand description

Reports what the daemon would do, and mounts nothing.

Implementations§

Source§

impl DryRun

Source

pub fn new(mount_root: PathBuf) -> Self

A reporter that prints to stdout.

Source

pub fn with_output(mount_root: PathBuf, out: Box<dyn Write + Send>) -> Self

A reporter that prints wherever you tell it. Tests capture the output.

Source

pub fn tally(&self) -> Tally

Totals so far.

Source

pub fn open_keys(&self) -> Vec<String>

Keys that arrived and haven’t left, sorted. Used by tests.

Source

pub fn run(self, commands: Receiver<DryRunCommand>)

Report events until DryRunCommand::Stop arrives or every sender is dropped, then print the summary.

Blocks the calling thread, like crate::daemon::supervisor::Supervisor::run, and for the same reason: the daemon keeps its runtime for the watch.

Source

pub fn banner(&mut self)

Header: what this mode does and what to do with it.

Source

pub fn arrived(&mut self, facts: &DeviceFacts)

Report an arrival.

Source

pub fn left(&mut self, facts: &DeviceFacts) -> DepartureVerdict

Report a departure, and say whether it matched. Returns the verdict so tests can assert on it without parsing the text.

Source

pub fn summary(&mut self, reason: &str)

The closing report: the thing to read after a few plug cycles.

Auto Trait Implementations§

§

impl !RefUnwindSafe for DryRun

§

impl !Sync for DryRun

§

impl !UnwindSafe for DryRun

§

impl Freeze for DryRun

§

impl Send for DryRun

§

impl Unpin for DryRun

§

impl UnsafeUnpin for DryRun

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.