Struct linemux::MuxedEvents[][src]

pub struct MuxedEvents { /* fields omitted */ }

Manages filesystem event watches, and can be polled to receive new events.

Internally, MuxedEvents contains a notify::Watcher from where filesystem events are proxied. Functionality such as async/await support, and nonexistent file registration are added.

Implementations

impl MuxedEvents[src]

pub fn new() -> Result<Self>[src]

Constructs a new MuxedEvents instance.

pub async fn add_file(&mut self, path: impl Into<PathBuf>) -> Result<PathBuf>[src]

Adds a given file to the event watch, allowing for files which do not yet exist.

Returns the canonicalized version of the path originally supplied, to match against the one contained in each notify::Event received. Otherwise returns Error for a given registration failure.

pub async fn next_event(&mut self) -> Result<Option<Event>>[src]

Returns the next event in the stream.

Waits for the next event from the set of watched files, otherwise returns Ok(None) if no files were ever added, or Err for a given error.

Trait Implementations

impl Debug for MuxedEvents[src]

impl Stream for MuxedEvents[src]

type Item = Result<Event>

Values yielded by the stream.

Auto Trait Implementations

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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> StreamExt for T where
    T: Stream + ?Sized
[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.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]