Crate isonantic_rs

Crate isonantic_rs 

Source
Expand description

§ISONantic for Rust

Type-safe validation and schema definitions for ISON format.

§Quick Start

use isonantic_rs::prelude::*;
use ison_rs::parse;

// Define a schema
let user_schema = table("users")
    .field("id", int().required())
    .field("name", string().min(1).max(100))
    .field("email", string().email())
    .field("active", boolean().default_value(true));

// Parse ISON text
let ison_text = r#"
table.users
id name email active
1 Alice alice@example.com true
"#;

// Parse and validate
let doc = parse(ison_text).expect("Parse failed");
let users = user_schema.validate(&doc).expect("Validation failed");

Re-exports§

pub use schema::*;
pub use validators::*;

Modules§

prelude
schema
Schema definitions for ISON validation
validators
Custom validators for ISON fields

Structs§

FieldError
Field validation error
ISONReference
ISON reference
ValidatedRow
A validated row of data
ValidatedTable
A validated table of rows
ValidationError
Validation error containing one or more field errors

Enums§

ValidatedValue
Validated ISON value

Constants§

VERSION
Library version

Type Aliases§

Result
Result type for validation operations