pub struct FolderChanges { /* private fields */ }Expand description
The waiting side of a FolderWatch; see FolderChanges::next.
Cheap to clone and free to move to another thread, so each
Command::perform can take its own.
Implementations§
Source§impl FolderChanges
impl FolderChanges
Sourcepub fn next(&self) -> Vec<FolderChange>
pub fn next(&self) -> Vec<FolderChange>
Blocks until something changes in a watched folder, then returns everything that changed within the next tenth of a second, oldest first and each change once. A burst of thousands of changes therefore arrives as a few batches, not as thousands of answers.
While nothing changes the thread sleeps in the kernel and costs no processor time. When the
FolderWatch is dropped, a waiting next wakes and returns an empty list, and so does
every later call: an empty answer means “stop waiting”. Call it inside
Command::perform, never in update or view.
A rename inside one folder is one FolderChangeKind::Renamed. An entry moved from one
watched folder to another is FolderChangeKind::Removed in the first and
FolderChangeKind::Created in the second, as it is when only one side is watched.
Trait Implementations§
Source§impl Clone for FolderChanges
impl Clone for FolderChanges
Source§fn clone(&self) -> FolderChanges
fn clone(&self) -> FolderChanges
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FolderChanges
impl RefUnwindSafe for FolderChanges
impl Send for FolderChanges
impl Sync for FolderChanges
impl Unpin for FolderChanges
impl UnsafeUnpin for FolderChanges
impl UnwindSafe for FolderChanges
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 more