use-constraint 0.0.1

Lightweight named constraint primitives for RustUse
Documentation
  • Coverage
  • 8.33%
    1 out of 12 items documented1 out of 10 items with examples
  • Size
  • Source code size: 6.23 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 388.73 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 29s Average build duration of successful builds.
  • all releases: 29s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-validate
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-constraint

Lightweight named constraint primitives for RustUse.

Install

[dependencies]
use-constraint = "0.0.1"

Foundation

use-constraint provides a Constraint<T, F> wrapper for named checks that answer whether a value satisfies a specific requirement.

Example

use use_constraint::Constraint;

let constraint = Constraint::<str, _>::new("non-empty", |value| !value.is_empty());
let evaluation = constraint.evaluate("rustuse");

assert_eq!(evaluation.label(), "non-empty");
assert!(evaluation.satisfied());

When to use directly

Choose use-constraint when you want a named must satisfy wrapper without a broader validation framework.

Scope

  • Constraints stay generic over a single input value.
  • Evaluation results stay small and explicit.
  • Error aggregation and reporting layers are out of scope.

Status

use-constraint is a pre-1.0 crate with a deliberately narrow API.