pub struct Wait<'a> { /* private fields */ }Expand description
State to wait for change to a path.
Implementations§
Source§impl<'a> Wait<'a>
impl<'a> Wait<'a>
Sourcepub fn from_path(path: &'a Path) -> Result<Self>
pub fn from_path(path: &'a Path) -> Result<Self>
Construct from a path for change detection. This reads the file stats immediately. If you also need to read the file content to double check whether to “wait” or not, call this before reading the file content to avoid races.
Sourcepub fn wait_for_change(&mut self) -> Result<()>
pub fn wait_for_change(&mut self) -> Result<()>
Wait for change on the given path. The path is expected to be
atomically updated (ex. inode should change on Linux).
If path does not exist, wait for it to be created.
Auto Trait Implementations§
impl<'a> Freeze for Wait<'a>
impl<'a> RefUnwindSafe for Wait<'a>
impl<'a> Send for Wait<'a>
impl<'a> Sync for Wait<'a>
impl<'a> Unpin for Wait<'a>
impl<'a> UnsafeUnpin for Wait<'a>
impl<'a> UnwindSafe for Wait<'a>
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