vstorage::watch

Trait StorageMonitor

Source
pub trait StorageMonitor: Send {
    // Required method
    fn next_event(&mut self) -> BoxFuture<'_, Event>;
}
Expand description

Monitors a storage for live events.

Implementations shall yield Event::General if:

  • The underlying storage does not support monitoring for individual changes. In this case, the event should be returned every interval.
  • There is a possibility that some events are lost (e.g.: due to having to reconnect, or a buffer overflow).

§See also

Required Methods§

Source

fn next_event(&mut self) -> BoxFuture<'_, Event>

Return the next event on this storage.

Returns a future which resolves the next change event.

§Cancel safety

This method MUST be cancel safe. If the returned future is dropped before completion, the next call MUST return the following event without dropping any events.

Implementors§