Skip to main content

validators

Attribute Macro validators 

Source
#[validators]
Expand description

Rebuild typed machines from persisted data.

Apply #[validators(Machine)] or an anchored path such as #[validators(self::path::Machine)], #[validators(super::path::Machine)], or #[validators(crate::path::Machine)] to an impl PersistedRow block. Statum expects one is_{state} method per state variant and generates into_machine(), .into_machines(), and .into_machines_by(...) helpers for typed rehydration. Validator methods can return Result<T, _> for ordinary membership checks or Validation<T> when rebuild reports should carry stable rejection details through .build_report() and .build_reports(). In relaxed mode, bare multi-segment paths like #[validators(flow::Machine)] are treated as local child-module paths, not imported aliases or re-exports. If Statum cannot resolve that local path, it emits a compile error asking for an anchored path instead.