pub struct FileWatcher {
pub debounce_ms: u64,
pub queue_capacity: usize,
/* private fields */
}Expand description
File system watcher for auto-regeneration
Fields§
§debounce_ms: u64Debounce duration (milliseconds)
queue_capacity: usizeQueue capacity
Implementations§
Source§impl FileWatcher
impl FileWatcher
Sourcepub fn new<P: AsRef<Path>>(watch_paths: Vec<P>) -> Self
pub fn new<P: AsRef<Path>>(watch_paths: Vec<P>) -> Self
Create a new FileWatcher with default settings
- Debounce: 300ms
- Queue capacity: 10 items
Sourcepub fn with_debounce_ms(self, debounce_ms: u64) -> Self
pub fn with_debounce_ms(self, debounce_ms: u64) -> Self
Set debounce duration in milliseconds
Sourcepub fn with_queue_capacity(self, capacity: usize) -> Self
pub fn with_queue_capacity(self, capacity: usize) -> Self
Set queue capacity
Sourcepub fn start(self) -> Result<Receiver<WatchEvent>>
pub fn start(self) -> Result<Receiver<WatchEvent>>
Start watching and return event receiver
This is a placeholder implementation. Real implementation would use
the notify crate for cross-platform file watching.
§Returns
A Receiver<WatchEvent> that yields file change events after debouncing.
Sourcepub fn wait_for_change(
rx: &Receiver<WatchEvent>,
timeout: Duration,
) -> Result<Option<WatchEvent>>
pub fn wait_for_change( rx: &Receiver<WatchEvent>, timeout: Duration, ) -> Result<Option<WatchEvent>>
Auto Trait Implementations§
impl Freeze for FileWatcher
impl RefUnwindSafe for FileWatcher
impl Send for FileWatcher
impl Sync for FileWatcher
impl Unpin for FileWatcher
impl UnwindSafe for FileWatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request