[][src]Struct listen::Listener

pub struct Listener {
    pub files: Vec<String>,
    // some fields omitted
}

A Listener

Fields

files: Vec<String>

Vector of all files currently in directory listened to.

Implementations

impl Listener[src]

pub fn new() -> Listener[src]

pub fn listen<T, R>(&mut self, path: &str, arg: T, func: fn(_: T) -> R)[src]

This function takes a path to listen on, the event to listen for, and a function to execute when that event happens.

path: &str is the directory to listen on, arg: T is the argument to pass to func, and func: fn(T) -> R is the function to execute when event happens

pub fn store_files(&mut self, store_files: bool)[src]

Configure listener to store files

Usage:

  let mut listener = listen::Listener::new();

  listener.store_files(true);

Trait Implementations

impl Debug for Listener[src]

impl Default for Listener[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.