Struct AsyncDebouncer

Source
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

pub async fn new_with_channel_and_opts<F: AsyncDebounceEventHandler + Send + 'static>( timeout: Duration, tick_rate: Option<Duration>, config: Config, ) -> Result<(Self, Receiver<Result<Vec<DebouncedEvent>, Vec<NotifyError>>>), 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. A handle to the debouncer is returned alongside a channel that can be used to receive events.

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.

Source

pub async fn new_with_channel( timeout: Duration, tick_rate: Option<Duration>, ) -> Result<(Self, Receiver<Result<Vec<DebouncedEvent>, Vec<NotifyError>>>), 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. A handle to the debouncer is returned alongside a channel that can be used to receive events.

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> Freeze for AsyncDebouncer<T>
where T: Freeze,

§

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 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 = 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 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.