pactum_annotations/
lib.rs1mod checks;
16mod civil_date;
17mod context;
18mod email;
19mod error;
20mod formats;
21mod norms;
22mod phone;
23mod schema;
24mod traits;
25
26#[doc(hidden)]
27pub use async_trait as __async_trait;
28
29pub use checks::{
30 alphanumeric, ascii, bool_is_true, digits, ends_with, finite_f64, list_len, list_unique,
31 list_unique_strings, non_empty, non_negative_i64, number_f64, number_i64, one_of, positive_i64,
32 prefix_nested, starts_with, string_len, timestamp_ms, LengthUnit, NumericValue,
33};
34pub use civil_date::{check_rfc3339, check_ymd, CivilDate};
35pub use context::ValidationContext;
36pub use email::check_email;
37pub use error::{AsyncValidationError, FieldIssue, HostError};
38pub use formats::{
39 check_charset, check_hex, check_hostname, check_ip, check_ipv4, check_ipv6, check_semver,
40 check_slug, check_url, check_uuid,
41};
42pub use norms::{clamp_f64, clamp_i64, lowercase, strip_whitespace, trim, uppercase, ClampNum};
43pub use phone::{check_phone_e164, check_phone_locale, dial_plan, DialPlan, DIAL_PLANS};
44pub use schema::{CommandSpec, FieldSchema, InvariantSpec, ModelKind, ModelSchema, VariantSchema};
45pub use traits::{
46 AsyncCheckOutcome, AsyncCheckResult, AsyncValidate, CheckOutcome, Client, DescribeModel,
47 IntoAsyncError, Normalize, ScopedValidate, Server, Validate,
48};
49
50pub use pactum_annotations_macros::Model;
52
53pub use pactum_annotations_macros::PactumModel;
55
56pub use pactum_annotations_macros::pactum_rule;
58
59pub use pactum_annotations_macros::define_rule;
61
62pub fn constraint_issue(field: &str, code: &str, reason: &str) -> FieldIssue {
64 FieldIssue::new(field, code, reason)
65}