Skip to main content

Detector

Trait Detector 

Source
pub trait Detector: Protocol<Note = Note> {
    // Required method
    fn classify(ind: Self::Ind) -> DetectorInd;
}
Expand description

What a layer above a failure detector may depend on.

Satisfying the port is a decision, not an accident of shape: a detector says so by implementing this, exactly as a link does. A protocol that has not is rejected when the project is built.

ⓘ
fn needs_a_detector<D: Detector>(_: D) {}
// `PerfectLink` is a protocol, and is not a detector.
needs_a_detector(recon_protocols::perfect_link::PerfectLink::<u32>::new(
    NodeId::new(1),
    core::time::Duration::from_millis(1),
));

Required Methods§

Source

fn classify(ind: Self::Ind) -> DetectorInd

Read one of this detector’s indications in the port’s terms.

Total, as crate::link::Link::classify is: every indication a detector raises is either a suspicion or the withdrawal of one, and a detector with something else to say would be saying it to a layer that cannot hear it.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Detector for EventuallyPerfectFailureDetector

Source§

impl Detector for PerfectFailureDetector

P satisfies the detector port, and never withdraws a suspicion.

PFD2 is strong accuracy — a detected process has crashed — so there is nothing to take back. The port’s second arm is unreachable over this detector rather than merely unused, which tests/detector_port.rs pins.