feat(protocol): add logical model and validation

This commit is contained in:
2026-09-24 05:29:20 +09:00
parent ba4ccf1e67
commit 742442f174
8 changed files with 1818 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
//! Transport-independent logical types for the Web Interface Protocol (WIP).
//!
//! This crate deliberately models interface declarations, published objects,
//! operation calls, and operation results without assigning them HTTP routes,
//! methods, headers, or JSON envelopes. A transport can encode these values,
//! but the encoding is outside this crate's contract.
#![deny(missing_docs)]
mod error;
mod model;
mod validation;
pub use error::{
NameNamespace, PathSegment, ProtocolError, ProtocolErrorCategory, ValidationError,
ValidationErrorKind, ValueKind,
};
pub use model::{
Documentation, EnumDeclaration, EnumVariantDeclaration, FieldDeclaration, InterfaceDescriptor,
InterfaceObservation, JsonMember, JsonValue, NamedValue, Object, ObjectId, OperationCall,
OperationDeclaration, OperationOutcome, OperationResult, OperationTarget, ParameterDeclaration,
RecordDeclaration, ReturnDeclaration, TypeDeclaration, TypeExpr, UnionDeclaration,
UnionVariantDeclaration, Value,
};
/// Largest integer that is exactly interoperable with a JavaScript `Number`.
pub const MAX_SAFE_INTEGER: i64 = 9_007_199_254_740_991;
/// Smallest integer that is exactly interoperable with a JavaScript `Number`.
pub const MIN_SAFE_INTEGER: i64 = -MAX_SAFE_INTEGER;