Skip to main content

Point

Trait Point 

Source
pub trait Point: 'static {
    type Input: Send + Sync + 'static;
    type Value: Send + 'static;

    const ID: PointId;
    const KIND: PointKind = PointKind::Alter;
}
Expand description

A hook point: one type per point, so its input and value are checked at compile time. Declared by the crate that owns the result.

Every listener of a point has the same shape: it reads the emit’s Input and edits a Value. An alter emit passes one value through the listeners in order; a collect emit gives each listener a fresh value and gathers them in a list.

Required Associated Constants§

Source

const ID: PointId

The point’s id, <crate>.<subject>.<moment>, checked when made: const ID: PointId = PointId::new("health.report"); does not compile with a bad id (PointId).

Provided Associated Constants§

Source

const KIND: PointKind = PointKind::Alter

What the point is for (PointKind); PointKind::Alter unless the point says otherwise.

Required Associated Types§

Source

type Input: Send + Sync + 'static

What every listener reads: shared, never changed by a listener.

Source

type Value: Send + 'static

What a listener edits: the value altered in turn, or one listener’s contribution to a collect.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§