pub struct AsyncDebouncer<T: Watcher> { /* private fields */ }

Implementations§

source§

impl<T: Watcher> AsyncDebouncer<T>

source

pub async fn stop(self)

source

pub fn watcher(&mut self) -> &mut dyn Watcher

source§

impl<T: Watcher> AsyncDebouncer<T>

source

pub async fn new_with_opts<F: AsyncDebounceEventHandler + Send + 'static>( timeout: Duration, tick_rate: Option<Duration>, event_handler: F, config: Config ) -> Result<Self, Error>

Creates a new debounced watcher with custom configuration. The timeout specifies the amount of time that must elapse before an event is emitted, or a continuous event is sent (if there still are events incoming for the specific path). If tick_rate is set to None, then a tick rate will be selected that is less than the provided timeout.

source§

impl AsyncDebouncer<RecommendedWatcher>

source

pub async fn new<F: AsyncDebounceEventHandler + Send + 'static>( timeout: Duration, tick_rate: Option<Duration>, event_handler: F ) -> Result<Self, Error>

Creates a new debounced watcher with the recommended watcher implementation. The timeout specifies the amount of time that must elapse before an event is emitted, or a continuous event is sent (if there still are events incoming for the specific path). If tick_rate is set to None, then a tick rate will be selected that is less than the provided timeout.

Trait Implementations§

source§

impl<T: Watcher> Drop for AsyncDebouncer<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for AsyncDebouncer<T>where T: RefUnwindSafe,

§

impl<T> Send for AsyncDebouncer<T>where T: Send,

§

impl<T> Sync for AsyncDebouncer<T>where T: Sync,

§

impl<T> Unpin for AsyncDebouncer<T>where T: Unpin,

§

impl<T> UnwindSafe for AsyncDebouncer<T>where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.