Skip to main content

Crate pjson_rs_domain

Crate pjson_rs_domain 

Source
Expand description

PJS Domain Layer - Pure Business Logic

This crate contains the pure domain logic for PJS (Priority JSON Streaming Protocol) with ZERO external dependencies (except thiserror for error handling).

The domain layer is WASM-compatible and can be used in both native and WebAssembly environments.

§Architecture

Following Clean Architecture principles:

  • Value Objects: Immutable, validated domain concepts (Priority, JsonPath, etc.)
  • Entities: Domain objects with identity (Frame, Stream)
  • Domain Events: State change notifications

§Features

  • std (default): Standard library support
  • serde: Serialization support for WASM interop
  • wasm: Enables WASM-specific optimizations

Re-exports§

pub use entities::Frame;
pub use entities::Stream;
pub use events::DomainEvent;
pub use events::SessionState;
pub use value_objects::JsonData;
pub use value_objects::JsonPath;
pub use value_objects::Priority;
pub use value_objects::Schema;
pub use value_objects::SessionId;
pub use value_objects::StreamId;

Modules§

entities
Domain entities with business logic and invariants
events
Domain events for event sourcing and integration
value_objects
Domain Value Objects

Enums§

DomainError
Domain-specific errors

Type Aliases§

DomainResult
Domain Result type