Skip to main content

Module error

Module error 

Source
Expand description

Error types for worker-matcher operations.

The crate uses a single sum-type, MatchingError, for every fallible operation, and a Result alias to keep call-sites concise.

The matching engine itself is infallible: scoring two workers always produces a crate::MatchResult. Errors arise from explicit validation steps such as crate::Worker::validate.

§Example

use worker_matcher::{MatchingError, Worker};

let empty = Worker::builder().build();
match empty.validate() {
    Err(MatchingError::MissingField(msg)) => {
        assert!(msg.contains("required"));
    }
    other => panic!("unexpected: {other:?}"),
}

Enums§

MatchingError
Errors that may be returned by worker-matcher operations.

Type Aliases§

Result
Result alias used throughout the crate.