Skip to main content

Notification

Enum Notification 

Source
pub enum Notification {
    Batch {
        watch: WatchId,
        changes: Vec<Change>,
    },
    Desync {
        watch: WatchId,
        cause: DesyncCause,
    },
    Completion {
        watch: WatchId,
        outcome: Outcome,
    },
    Suspended {
        watch: WatchId,
    },
    Resumed {
        watch: WatchId,
    },
    Established {
        watch: WatchId,
        mode: WatchMode,
    },
    RetryQuestion {
        watch: WatchId,
        operation: FaultOperation,
        detail: FaultDetail,
    },
    VolumeChanged {
        watch: WatchId,
        previous: VolumeIdentity,
        current: VolumeIdentity,
    },
}
Expand description

One item a client receives, always tagged with the subscription it belongs to.

Changes and desyncs ride the same queue so their order relative to one another is well defined within a subscription (D-12): a client that sees a Desync knows every change enqueued before it, and none after, is accounted for.

Variants§

§

Batch

The changes one completion carried, in the order the kernel reported them.

Fields

§watch: WatchId

The subscription these changes belong to.

§changes: Vec<Change>

The changes, in kernel order.

§

Desync

Changes were lost; the client should re-scan (D-12).

Fields

§watch: WatchId

The subscription affected.

§cause: DesyncCause

How the gap arose. Advisory for the four recoverable causes – the response is a re-scan either way – but DesyncCause::Stopped is terminal and must be matched on.

§

Completion

A request the client made has been serviced (D-30).

Carried on this queue rather than a side channel so that its ordering against data is structural rather than temporal.

Fields

§watch: WatchId

The subscription the request concerned.

§outcome: Outcome

What happened.

§

Suspended

The watch stopped delivering while the monitor works to re-establish it (D-14/D-15/D-31). Opt-in via WatchOptions::report_liveness (D-13).

Fields

§watch: WatchId

The subscription affected.

§

Resumed

The watch is delivering again after a Notification::Suspended. A Notification::Desync { Reestablished } always precedes or accompanies this, since the gap it bridges may have hidden changes. Opt-in (D-13).

Fields

§watch: WatchId

The subscription affected.

§

Established

Which tier is actually watching this subscription’s target, reported once at first establishment and again after every re-establishment: WatchMode::Detailed or the WatchMode::Coarse fallback (D-17). Opt-in (D-13).

Fields

§watch: WatchId

The subscription affected.

§mode: WatchMode

The tier now watching.

§

RetryQuestion

The monitor is asking this interactive subscription (D-27) how long to wait before the next attempt. Answer through crate::session::Session::answer; an explicit answer(watch, None) declines, which is counted at the operation’s default delay – never answering at all leaves the question outstanding indefinitely. This is the one message a fault protocol cannot afford to lose, so it rides a standing reservation (Sender::reserve_standing) taken once at registration rather than the best-effort path – sound because a watcher cannot fault twice concurrently (D-28), so at most one question per subscription is ever outstanding.

Fields

§watch: WatchId

The subscription being asked.

§operation: FaultOperation

Which operation faulted.

§detail: FaultDetail

The classification and raw code behind the failure (D-79).

§

VolumeChanged

A path-based reopen landed on a different volume than this subscription started on, and it opted into crate::VolumeChangePolicy::Confirm (D-78/M12). Answer through crate::session::Session::answer_volume_change; crate::VolumeChangeDecision::Stop removes just this subscription, crate::VolumeChangeDecision::Continue keeps it running against the new volume. Rides the same standing reservation RetryQuestion does (never outstanding at the same time for one subscription, D-28).

Fields

§watch: WatchId

The subscription being asked.

§previous: VolumeIdentity

The volume this subscription was previously confirmed on.

§current: VolumeIdentity

The volume the reopen just landed on.

Implementations§

Source§

impl Notification

Source

pub fn watch(&self) -> WatchId

The subscription this notification belongs to.

Trait Implementations§

Source§

impl Clone for Notification

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Notification

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Notification

Source§

impl PartialEq for Notification

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Notification

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.