rustclamp-core 1.0.0

Minimal shared contracts for Clamp applications.
Documentation
  • Coverage
  • 100%
    74 out of 74 items documented1 out of 56 items with examples
  • Size
  • Source code size: 47.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 910.7 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • rustclamp/core
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Nejcc github:rustclamp:owners

rustclamp-core

Core component of RustClamp: minimal, domain-neutral contracts shared by the other components. It defines contracts and identities; resolution and runtime behavior live in kernel and runtime. No external dependencies on Unix (Windows adds getrandom for its random source), no Tokio or async required. Companion crate, not a standalone framework.

Install

Rust 1.96.1+, edition 2024:

[dependencies]
rustclamp-core = "1"

Example

use std::time::{Duration, UNIX_EPOCH};
use rustclamp_core::{Clock, ManualClock};

let clock = ManualClock::new(UNIX_EPOCH);
clock.advance(Duration::from_secs(60));
let now = (&clock as &dyn Clock).now(); // deterministic time for tests

Main API

  • Time: Clock (Send + Sync, so &dyn Clock moves into threads and tasks), SystemClock, ManualClock (set, advance), ClockCapability.
  • Identity: Reference (UUIDv7 naming a request, command or action; created_at, Reference::range), ModuleId, CapabilityId, QualifierId, ApplicationId, ProcessId, ExecutionId, ContributionId, ContributionTargetId.
  • Modules: Module, Requires<C>, Provides<C>, Capability, Qualifier.
  • Contributions: Contribution, ContributionTarget; each target owns validation and the runtime representation it builds.
  • Lifecycle: LifecycleContext plus opt-in Initialize, Start, Ready, Drain, Stop; a module implements any subset.

Feature flags: none. See CHANGELOG.md.

Documentation

https://docs.rustclamp.com

Development

cargo fmt --all -- --check
cargo clippy --offline --locked --all-targets --all-features -- -D warnings
cargo test --offline --locked --all-features
RUSTDOCFLAGS="-D warnings" cargo doc --offline --locked --no-deps --all-features

Coordinated checkout, architecture checks and release policy: see the facade contributor guide.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you state otherwise, any contribution you submit for inclusion is dual licensed as above, without additional terms or conditions.