callback: F,
) -> Result<WatchHandle, Error> {
let state = Box::pin(Mutex::new(WatchState {
callback: F,
) -> Result<WatchHandle, Error> {
let state = Box::pin(Mutex::new(WatchState {
// Trigger an initial update.
// This is allowed to race with true updates because it
// will always calculate a diff and discard no-ops.
// Trigger an initial update.
// This is allowed to race with true updates because it
// will always calculate a diff and discard no-ops.
// Then return the handle
Ok(WatchHandle { hnd, _state: state })
}
// Then return the handle
Ok(WatchHandle { hnd, _state: state })
}