pactum_annotations/
lib.rs1mod checks;
7mod civil_date;
8mod context;
9mod email;
10mod error;
11mod formats;
12mod norms;
13mod phone;
14mod schema;
15mod traits;
16
17pub use checks::{
18 alphanumeric, ascii, bool_is_true, digits, ends_with, finite_f64, list_len, list_unique,
19 list_unique_strings, non_empty, non_negative_i64, number_f64, number_i64, one_of, positive_i64,
20 prefix_nested, starts_with, string_len, timestamp_ms, LengthUnit, NumericValue,
21};
22pub use civil_date::{check_rfc3339, check_ymd, CivilDate};
23pub use context::ValidationContext;
24pub use email::check_email;
25pub use error::FieldIssue;
26pub use formats::{check_charset, check_slug, check_url, check_uuid};
27pub use norms::{clamp_f64, clamp_i64, lowercase, strip_whitespace, trim, uppercase, ClampNum};
28pub use phone::{check_phone_e164, check_phone_locale, dial_plan, DialPlan, DIAL_PLANS};
29pub use schema::{CommandSpec, FieldSchema, InvariantSpec, ModelKind, ModelSchema, VariantSchema};
30pub use traits::{CheckOutcome, DescribeModel, Normalize, Validate};
31
32pub use pactum_annotations_macros::Model;
34
35pub use pactum_annotations_macros::PactumModel;
37
38pub use pactum_annotations_macros::pactum_rule;
40
41pub use pactum_annotations_macros::define_rule;
43
44pub fn constraint_issue(field: &str, code: &str, reason: &str) -> FieldIssue {
46 FieldIssue::new(field, code, reason)
47}