icydb-model 0.213.38

IcyDB application-model authoring, validation, and code generation
Documentation
//! Module: base::types::ident
//!
//! Responsibility: base domain type declarations.
//! Does not own: runtime storage, query execution, or validator implementation internals.
//! Boundary: declares macro-modeled domain wrappers and records for downstream schemas.

use crate::prelude::*;

///
/// Constant
///

#[newtype(
    source_key = "crates/icydb/src/base/types/ident.rs::newtype::1",
    primitive = "Text",
    item(prim = "Text", unbounded),
    ty(
        rule(
            source_key = "icydb.base.rule.ident.constant.length.v1",
            kind = "length_range_inclusive",
            args(1, 40)
        ),
        validator(path = "base::validator::text::case::UpperSnake"),
    )
)]
pub struct Constant {}

///
/// Field
///

#[newtype(
    source_key = "crates/icydb/src/base/types/ident.rs::newtype::2",
    primitive = "Text",
    item(prim = "Text", unbounded),
    ty(
        rule(
            source_key = "icydb.base.rule.ident.field.length.v1",
            kind = "length_range_inclusive",
            args(2, 40)
        ),
        validator(path = "base::validator::text::case::Snake"),
    )
)]
pub struct Field {}

///
/// Function
///
/// 30 characters, snake_case
///

#[newtype(
    source_key = "crates/icydb/src/base/types/ident.rs::newtype::3",
    primitive = "Text",
    item(prim = "Text", unbounded),
    ty(
        rule(
            source_key = "icydb.base.rule.ident.function.length.v1",
            kind = "length_range_inclusive",
            args(2, 64)
        ),
        validator(path = "base::validator::text::case::Snake"),
    )
)]
pub struct Function {}

///
/// Variable
///

#[newtype(
    source_key = "crates/icydb/src/base/types/ident.rs::newtype::4",
    primitive = "Text",
    item(prim = "Text", unbounded),
    ty(
        rule(
            source_key = "icydb.base.rule.ident.variable.length.v1",
            kind = "length_range_inclusive",
            args(2, 40)
        ),
        validator(path = "base::validator::text::case::Snake"),
    )
)]
pub struct Variable {}

///
/// Variant
///

#[newtype(
    source_key = "crates/icydb/src/base/types/ident.rs::newtype::5",
    primitive = "Text",
    item(prim = "Text", unbounded),
    ty(
        rule(
            source_key = "icydb.base.rule.ident.variant.length.v1",
            kind = "length_range_inclusive",
            args(1, 40)
        ),
        validator(path = "base::validator::text::case::UpperCamel"),
    )
)]
pub struct Variant {}