Expand description
Module: lib
Responsibility: public facade crate surface and generated-code wiring. Does not own: core execution, storage internals, or schema mutation semantics. Boundary: re-exports stable runtime and generated actor-wiring surfaces.
§icydb
icydb is the public facade crate for the IcyDB runtime.
It is the recommended dependency for downstream canister projects.
This crate exposes:
- the stable runtime surface used inside canister actor code,
- accepted-schema-bound database request and response types,
- and a small set of entry points that wire generated actor code.
Low-level execution, storage, and engine internals live in
icydb-core and are re-exposed selectively through stable facade modules.
§Crate layout
-
build(host builds) Host-side build-script facade for generated actor glue. Downstream canisterbuild.rsfiles should use this module rather than depending on lower-level implementation crates directly. -
modelApplication-model declarations, macros, reusable types, validation, and normalization. Runtime-enabled downstream crates should use this re-export instead of adding a second IcyDB package dependency. -
traits/types/valueStable runtime building blocks used by generated code. -
metrics(internal) Runtime metrics internals exposed for generated administration endpoints. -
Error/ErrorKind/ErrorOriginShared error types for generated code and runtime boundaries. -
dbThe public database façade: sessions, SQL/dynamic reads, structural mutations, and accepted-schema-bound typed adapters.
Generated SQL endpoints are controller-gated by default. A declaration may instead install one synchronous application read guard; neither form is an anonymous public read endpoint template.
The operational lane contract lives in
docs/contracts/READ_ADMISSION.md.
Endpoint migration recipes live in docs/guides/read-intent.md.
§Preludes
preludeOpinionated runtime prelude for canister actor code. Intended to be glob-imported inlib.rsto keep endpoints concise.
§Internal boundaries
Generated code targets explicit facade surfaces (traits, db, and
__macro) instead of a broad internal-export module.
Re-exports§
pub use guards::ReadAuthorizationContext;pub use guards::ReadAuthorizationDecision;pub use guards::ReadAuthorizationGuard;pub use guards::ReadAuthorizationSurface;pub use icydb_model as model;
Modules§
- build
- Host-side build-script facade for generated actor glue.
- db
- Module: db
- diagnostic
- Compact diagnostic identity for CLI and canister callers.
- guards
- Bounded application-supplied read-authorization contracts.
- prelude
- traits
- Module: traits
- value
Macros§
- build_
canister - Generate one canister’s private actor module from its authored schema type.
- db
- Access the active request’s database session.
- endpoints
- Declare the complete fixed IcyDB endpoint surface exported by this canister.
- start
- Include the generated private actor module emitted by
build_canister!.
Structs§
- Constraint
Validation Finding Output - ConstraintValidationFindingOutput
- Constraint
Value Path - ConstraintValuePath
- Diagnostic
Fact - One bounded numeric parameter attached to a public IcyDB error.
- Error
- Error
- Error
Code - ErrorCode
- Parse
U256 Error - Error returned when text or a Candid natural is outside the unsigned 256-bit domain.
- Query
Field Diagnostic - One bounded rejected query-field reference attached to a planning error.
- U256
- IcyDB-owned fixed-width unsigned 256-bit scalar.
Enums§
- Constraint
Value Path Component - ConstraintValuePathComponent
- Error
Kind - ErrorKind
- Error
Origin - ErrorOrigin
- Query
Error Kind - QueryErrorKind
- Runtime
Error Kind - RuntimeErrorKind
Constants§
Attribute Macros§
- request_
execution - Install one aggregate IcyDB execution root for a sync or async entry point.
- test
- Declare a synchronous unit test with the production request boundary.