Skip to main content

Crate substrate

Crate substrate 

Source
Expand description

Substrate - Shared library for CMN (Code Mycelial Network)

This library provides common data structures and utilities shared between hypha (client) and synapse (indexer).

Zero I/O, WASM-compatible. All algorithms (tree hashing, signatures, schema validation) operate on in-memory data only. Filesystem traversal lives in downstream crates (e.g. cmn-hypha).

Re-exports§

pub use crypto::compute_blake3_hash;
pub use crypto::compute_signature;
pub use crypto::format_hash;
pub use crypto::format_key;
pub use crypto::format_signature;
pub use crypto::parse_hash;
pub use crypto::parse_key;
pub use crypto::parse_signature;
pub use crypto::verify_json_signature;
pub use crypto::verify_signature;
pub use crypto::HashAlgorithm;
pub use crypto::KeyAlgorithm;
pub use crypto::SignatureAlgorithm;
pub use schemas::detect_schema_type;
pub use schemas::validate as validate_schema;
pub use schemas::SchemaType;
pub use tree::compute_tree_hash_from_entries;
pub use tree::flatten_entries;
pub use tree::max_mtime;
pub use tree::walk_dir;
pub use tree::DirEntry;
pub use tree::DirReader;
pub use tree::TreeEntry;
pub use uri::build_domain_uri;
pub use uri::build_mycelium_uri;
pub use uri::build_spore_uri;
pub use uri::build_taste_uri;
pub use uri::cmn_entry_url;
pub use uri::normalize_and_validate_url;
pub use uri::normalize_taste_target_uri;
pub use uri::parse_uri;
pub use uri::validate_domain;
pub use uri::CmnUri;
pub use uri::CmnUriKind;
pub use util::compare_version_timestamps;
pub use util::local_dir_name;
pub use util::validate_timestamp_not_future;
pub use util::VersionOrder;
pub use model::*;

Modules§

crypto
Cryptographic utilities for CMN.
model
Typed protocol models for CMN.
schemas
JSON Schema validation for CMN documents
tree
Tree hashing for spores.
uri
CMN URI parsing and URL policy utilities.
util
Local projection helpers and timestamp utilities.