pub struct DatabaseChanges<E> { /* private fields */ }Expand description
A live commit observation. DatabaseChanges merges several commits into
one change and ends when the writer closes. Its methods convert the
handle’s failure into E and return that.
Implementations§
Source§impl<E> DatabaseChanges<E>
impl<E> DatabaseChanges<E>
Sourcepub fn take_changed(&mut self) -> Result<bool, E>
pub fn take_changed(&mut self) -> Result<bool, E>
Whether a relevant commit happened since the previous observation, without waiting; the first call reports the initial state.
Sourcepub fn changed(&self) -> impl Future<Output = ()> + Send + 'static
pub fn changed(&self) -> impl Future<Output = ()> + Send + 'static
Resolves once a relevant commit happened since the previous
observation, or the handle failed or closed. The future owns a clone
of the subscription, so a worker can wait on it beside other futures;
take_changed then consumes the change.
Auto Trait Implementations§
impl<E> !RefUnwindSafe for DatabaseChanges<E>
impl<E> !UnwindSafe for DatabaseChanges<E>
impl<E> Freeze for DatabaseChanges<E>
impl<E> Send for DatabaseChanges<E>
impl<E> Sync for DatabaseChanges<E>
impl<E> Unpin for DatabaseChanges<E>
impl<E> UnsafeUnpin for DatabaseChanges<E>
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