NoopObserver

Type Alias NoopObserver 

Source
pub type NoopObserver<'i, S, D = Zero> = GeneralObserver<'i, NoopHandler, S, D>;
Expand description

A general observer that never reports changes.

NoopObserver is a no-operation Observer that always returns None when collecting changes, effectively ignoring all mutations to the observed value.

§Derive Usage

Can be used via the #[observe(noop)] attribute in derive macros:

#[derive(Serialize, Observe)]
struct MyStruct {
    important_field: String,
    #[observe(noop)]
    cache: String,      // Changes to cache are not tracked
}

§When to Use

Use NoopObserver for fields that:

  • Are only used internally and not part of the public state
  • Should not trigger change notifications.

Aliased Type§

pub struct NoopObserver<'i, S, D = Zero> { /* private fields */ }