Skip to main content

mkit_server/
lib.rs

1#![forbid(unsafe_code)]
2#![cfg_attr(not(test), deny(clippy::print_stdout, clippy::print_stderr))]
3#![doc = include_str!("../README.md")]
4//!
5//! This crate is runtime-agnostic: it compiles for the host and for
6//! `wasm32-unknown-unknown`, never reads the wall clock directly (see
7//! [`Clock`]) and never spawns on a concrete executor (see [`Spawner`]).
8//! The shared vocabulary is re-exported at the crate root from private
9//! modules. The protocol logic lives in public modules, so call sites name
10//! the protocol they apply (`refs::evaluate_cas`, `quota::evaluate_quota`).
11//! The storage contract lives in [`store`]: its contract types are also
12//! re-exported at the root, its key layouts, value codecs and typed
13//! readers stay namespaced (`store::keys`, `store::codec`, `store::read`),
14//! as do the export/import helpers and the `ContentIndex` row types
15//! (`store::export_partition`, `store::Holder`).
16//! The `memory` feature adds the in-memory reference backends; the native
17//! `fs` feature adds the `fs` module, the stores over the `.mkit` on-disk
18//! layout; the `sql` feature adds `sql::SqlKvStore`, the store over any
19//! synchronous `sql::SqlConn`; the `ssh` feature adds the `ssh` module, the
20//! `mkit.rpc.v1.ssh` session over the pipeline. The `connect` feature
21//! (default) adds the `mkit.transport.v1` Connect binding over the pipeline
22//! ([`connect::service`]); the `remote-hooks` feature adds the `hooks` module,
23//! the `mkit.server.hooks.v1` adapter over a transport-agnostic channel; the
24//! `http-objects` feature adds the `http_objects` module and
25//! `Pipeline::serve_http_object` (explicit indexed HTTP opt-in).
26
27pub mod admin;
28pub mod auth_v2;
29pub mod authority;
30#[cfg(feature = "connect")]
31pub mod connect;
32pub mod download;
33mod error;
34#[cfg(all(feature = "fs", not(target_arch = "wasm32")))]
35pub mod fs;
36#[cfg(feature = "remote-hooks")]
37pub mod hooks;
38#[cfg(feature = "http-objects")]
39pub mod http_objects;
40pub mod indexed;
41#[cfg(any(test, feature = "memory"))]
42mod memory;
43mod op;
44pub mod pipeline;
45pub mod policy;
46mod principal;
47pub mod purge;
48pub mod quota;
49pub mod refs;
50pub mod relay;
51mod replay;
52mod repo;
53mod rt;
54pub mod scanner_retrieval;
55#[cfg(feature = "sql")]
56pub mod sql;
57#[cfg(feature = "ssh")]
58pub mod ssh;
59pub mod storage_error;
60pub mod store;
61pub mod takedown;
62pub mod telemetry;
63pub mod timers;
64pub mod upload;
65pub mod url_token;
66
67pub use error::{
68    ADMISSION_CHALLENGE_TYPE, Code, ErrorDetail, InvalidHeader, Redacted, ServerError,
69};
70#[cfg(any(test, feature = "memory"))]
71pub use memory::{MemoryBlobStore, MemoryFault, MemoryKv, MemoryPackSink};
72pub use op::{
73    AuthzFacts, Commitment, Creation, GrantRef, OpKind, Operation, PresenceRequirement, Procedure,
74    RefUpdate, VerifiedAuth,
75};
76pub use policy::GrantConfig;
77pub use principal::Principal;
78pub use replay::{
79    BeginUploadResult, ReplayDecision, ReplayKey, ReplayRecord, ReplayState, StoredRejection,
80    StoredResult, UpdateRefResult, classify,
81};
82pub use repo::{Addressing, MultiAddressing, NamespaceKey, RepoId, RepoName, ResolvedRepo};
83#[cfg(not(target_arch = "wasm32"))]
84pub use rt::SystemClock;
85pub use rt::{
86    BoxFuture, BoxStream, Clock, Elapsed, ManualClock, ManualSleep, MaybeSend, MaybeSync, Sleep,
87    Spawner, send_wrap, with_timeout,
88};
89pub use store::{
90    Batch, BatchOutcome, BlobBody, BlobKey, BlobMeta, BlobNamespace, BlobStore, BoxError,
91    ByteRange, CommitOutcome, ContentIndex, Cursor, Key, KeyClasses, MAX_BATCH_BYTES,
92    MAX_BATCH_OPS, MAX_KEY_BYTES, MAX_SCAN_RANGES, MAX_VALUE_BYTES, MembershipMode,
93    MultipartBlobStore, NamespaceStore, PackSink, PartRef, PartSink, Partition, PartitionStats,
94    Precondition, RangeScan, ScanPage, StateCommitment, StoreCapabilities, StoreError,
95    StoreMaintenance, UnsupportedPartSink, Value, Write, is_reserved_pack_keyspace,
96};
97pub use telemetry::{
98    METRIC_LATENCY, METRIC_REQUESTS, METRIC_UPLOAD_BYTES, Metrics, NEVER_ECHO, NEVER_LOG,
99    NoopMetrics, REDACTED_VALUE, Redactor, is_never_echo, is_never_log,
100};