Expand description
Wire types and durable-format codecs for LoonFS.
Everything that crosses a process or storage boundary is defined here:
validated identifier and path types at the crate root, the versioned HTTP
protocol shapes in v0, and the durable storage formats in wire
(WAL segments, metadata SSTs, namespace manifests, and control objects).
Other LoonFS crates depend on this one for vocabulary; it depends on none
of them.
One module here is deliberately not a boundary format: options holds
the per-operation argument structs that the embedded runtime and the HTTP
client both expose. They parameterize the same semantic operations on both
surfaces, so this crate — the shared vocabulary — owns the single
definition rather than each surface keeping its own copy to drift.
One module is a function rather than a shape: commit_identity computes
the durable fingerprint of a mutation. It lives here for the same reason
the operation language does — the engine that stamps a fingerprint on a
commit receipt and the client that recomputes one to prove a retry is the
same request must produce identical values, so there is one implementation
and no second reading of the rules.
Module rule: v0 HTTP shapes live in v0; the crate root keeps the
ids/paths/errors/wire-format modules and re-exports the common v0
surface as a curated explicit list below.
Re-exports§
pub use v0::AdvanceRetentionResponse;pub use v0::ApiError;pub use v0::AuthoritativeFileBytes;pub use v0::AuthoritativePathEntry;pub use v0::CheckpointOwnerSummary;pub use v0::CheckpointSummary;pub use v0::CommitRequest;pub use v0::CommitResponse;pub use v0::CreateCheckpointRequest;pub use v0::CreateCheckpointResponse;pub use v0::CreateNamespaceRequest;pub use v0::DeleteDirectoryBehavior;pub use v0::DeleteNamespaceResponse;pub use v0::DestinationBehavior;pub use v0::ErrorDetails;pub use v0::FileRevision;pub use v0::FilesystemOperation;pub use v0::FlushWalOutcome;pub use v0::FlushWalResponse;pub use v0::ForkNamespaceRequest;pub use v0::GcRequest;pub use v0::GcResponse;pub use v0::GrepMatch;pub use v0::GrepRequest;pub use v0::GrepResponse;pub use v0::ListCheckpointsResponse;pub use v0::ListFileRevisionsResponse;pub use v0::ListPathEntriesResponse;pub use v0::ListTrashResponse;pub use v0::MaintenanceStepKind;pub use v0::MaintenanceStepRequest;pub use v0::MaintenanceStepResponse;pub use v0::NamespaceStatusResponse;pub use v0::NamespaceSummary;pub use v0::ReleaseCheckpointResponse;pub use v0::ReorganizeStepOutcome;pub use v0::RetainedCandidates;pub use v0::RetainedReason;pub use v0::TrashEntry;pub use v0::WalFlushStepOutcome;
Modules§
- options
- Per-operation option shapes shared by the runtime and client surfaces.
- v0
- The v0 HTTP protocol shapes.
- wire
- Durable wire formats grouped by their owning format family.
Structs§
- Absolute
Path - Canonical absolute path plus its parsed components.
- Capability
Document - A deployment’s self-description (API spec, “Capability discovery”).
- Change
Seq - Monotonically increasing namespace commit sequence number.
- Checkpoint
Id - Durable checkpoint identifier.
- Commit
Id - Client-supplied idempotency key for one logical commit.
- Commit
IdValidation Error - Describes why supplied text does not satisfy this identifier’s validation contract.
- Content
Id - Durable identity of one immutable content object.
- Content
Ref - Pointer to one immutable content object.
- Content
Store Id - Durable id for an immutable content store.
- Crc64
Nvme - CRC-64/NVME over a payload delivered in pieces.
- Directory
Page Cursor - Cursor for one directory listing position.
- Display
Name - User-facing spelling of one path component.
- Effective
Limit - A validated page size selected from a caller request and a policy.
- File
Revisions Page Cursor - Cursor for one file revision listing position.
- Generated
IdValidation Error - Describes why supplied text does not satisfy this identifier’s validation contract.
- Grep
Page Cursor - Cursor for one content-search (grep) snapshot.
- Index
Segment Id - Durable id for one derived-index segment file.
- InodeId
- Numeric identity of a file or directory within a namespace.
- Manifest
Id - Monotonically increasing namespace manifest identity.
- Manifest
Object Id - Durable object id for one namespace manifest candidate.
- Metadata
Table Id - Durable id for one metadata SST table file.
- NameKey
- Name-policy-derived directory entry key.
- Name
KeyValidation Error - Describes why supplied text does not satisfy this identifier’s validation contract.
- Namespace
Id - Durable id for one namespace.
- Namespace
IdValidation Error - Describes why supplied text does not satisfy this identifier’s validation contract.
- Page
- Typed result envelope for internal runtime/core page methods.
- Page
Request - Typed request envelope for internal runtime/core page methods.
- Pagination
Policy - Deployment or namespace policy for paginated endpoints.
- Path
Component - One path segment as stored, preserving display spelling.
- Revision
No - Monotonically increasing file revision counter within one file inode.
- Semantic
Fingerprint Error - A canonical preimage that could not be encoded.
- Sha256
- SHA-256 over a payload delivered in pieces.
- Storage
Checksum - A checksum computed over the complete bytes of one content object.
- Trash
Page Cursor - Cursor for one trash listing position.
- Upload
Id - Durable id for one upload session.
- WalSegment
Id - Durable id for one WAL segment.
- Writer
Epoch - Monotonically increasing writer epoch for namespace write fencing.
Enums§
- Capability
Document Error - Violation of the capability document rules.
- Checksum
Algorithm - Algorithm of a stored full-object checksum.
- Content
RefKind - Kind of content reference.
- Content
RefValidation Error - Describes why a content reference cannot be part of a durable commit.
- Error
Code - Stable machine-readable error reason.
- Error
Kind - Broad error category for caller or operator action.
- Inode
Kind - Filesystem item kind.
- Limit
Error - Invalid caller-supplied page size.
- Namespace
Cursor Error - Why a namespace-bound cursor cannot resume the enumeration replaying it.
- Page
Cursor Error - Invalid opaque page cursor.
- Pagination
Policy Error - Invalid pagination policy configuration.
- Path
Error - Describes why caller-supplied path or display-name text is not admissible.
- Streaming
Checksum - One full-object checksum folded over a payload delivered in pieces.
Constants§
- DEFAULT_
MAX_ PAGE_ LIMIT - Default maximum accepted page size.
- DEFAULT_
PAGE_ LIMIT - Default page size for endpoints that can return unbounded result sets.
- FEATURE_
DOWNLOADS_ DIRECT_ GET - Gates download grants that are authorized with short-lived presigned URLs. It rests on the same proof the two upload keys do, and is advertised with them, because a deployment that lets a client write an object it is too large to proxy back has to be able to hand it back.
- FEATURE_
NAMESPACES_ CREATE - Gates namespace creation.
- FEATURE_
NAMESPACES_ DELETE - Gates namespace deletion.
- FEATURE_
NAMESPACES_ FORK - Gates namespace forking.
- FEATURE_
QUERY_ GREP - Gates grep-index content search: the serving half of the capability; the namespace’s verified steady-state grep root is the data half.
- FEATURE_
UPLOADS_ DIRECT_ MULTIPART - Starting presigned
direct_multipartupload sessions. - FEATURE_
UPLOADS_ DIRECT_ PUT - Gates direct upload sessions that are authorized with short-lived presigned URLs.
- LIMIT_
COMMIT_ MAX_ CONTENT_ TOKENS - Advisory limit: the most content tokens one commit may carry.
- LIMIT_
COMMIT_ MAX_ EXTERNAL_ CONTENT_ REFS - Advisory limit: the most distinct external content refs one commit’s operations may name.
- LIMIT_
COMMIT_ MAX_ MESSAGE_ BYTES - Advisory limit: the largest accepted commit
message, in bytes. - LIMIT_
COMMIT_ MAX_ OPERATIONS - Advisory limit: the most path operations one commit may carry; a longer
list answers
invalid_requestbefore planning. - LIMIT_
DOWNLOAD_ MAX_ CONCURRENT - Advisory limit: how many service-proxied content reads the deployment
materializes at once; requests past the cap answer
server_busy. - LIMIT_
DOWNLOAD_ MAX_ CONTENT_ BYTES - Advisory limit: the largest file content a service-proxied read will buffer and return in one response.
- LIMIT_
GC_ MIN_ GRACE_ WINDOW_ MS - Advisory limit: the smallest accepted
grace_window_mson agcrequest; smaller values answerinvalid_request. Derived from the publication budgets, not tuned. - LIMIT_
PAGINATION_ DEFAULT - Advisory capability key for the default page size applied when callers omit
limit. - LIMIT_
PAGINATION_ MAX - Advisory capability key for the largest page size accepted by a deployment.
- LIMIT_
QUERY_ GREP_ DEFAULT - Advisory limit: matches per grep page when the request omits
limit. - LIMIT_
QUERY_ GREP_ MAX - Advisory limit: the largest accepted grep page limit. Distinct from the pagination keys — a grep item costs a verified file read, not a row.
- LIMIT_
QUERY_ GREP_ SCAN_ BUDGET_ FILES - Advisory limit: files a plan-less
allow_scangrep will scan before refusing withquery_unindexable. - LIMIT_
QUERY_ GREP_ TAIL_ BUDGET_ FILES - Advisory limit: unindexed-tail revisions one grep scans exhaustively
before failing with
index_lagging. - LIMIT_
UPLOAD_ MAX_ CONCURRENT - Advisory limit: how many service-proxied upload bodies the deployment
buffers at once; requests past the cap answer
server_busy. - LIMIT_
UPLOAD_ MAX_ CONTENT_ BYTES - Advisory limit: the largest request body accepted for service-proxied upload content requests.
- MAX_
DISPLAY_ NAME_ BYTES - Maximum stored display-name length in UTF-8 bytes: the 255-byte component cap of mainstream filesystems (ext4, APFS, NTFS components) and drives. Names are stored as given, so the cap applies to the bytes as given.
- MAX_
ID_ BYTES - Maximum validated namespace and commit id length in UTF-8 bytes.
- MAX_
NAME_ KEY_ BYTES - Maximum name-key length in UTF-8 bytes. Keys are derived from display
names capped at
crate::path::MAX_DISPLAY_NAME_BYTES; case folding expands at most threefold in bytes, so 768 admits every key derivable from a valid name while bounding row keys, filter keys, and cursors. - MAX_
PATH_ BYTES - Largest canonical absolute path, in UTF-8 bytes. Bounded so every real filesystem, archive format, and sync client can materialize any stored tree; per-component limits alone allowed paths no target could hold.
- MAX_
PATH_ DEPTH - Deepest directory nesting one path may express.
- PAGE_
CURSOR_ VERSION - Wire cursor format version.
- PROFILE_
ADMIN_ V0 - The optional maintenance plane.
- PROFILE_
CORE_ V0 - The mandatory data plane.
- PROFILE_
QUERY_ V0 - The optional derived-index query plane.
- PROTOCOL_
VERSION - The protocol generation this build speaks.
- ROOT_
INODE_ ID - Inode 1 is always the root directory of a namespace.
Traits§
- Namespace
Cursor - A cursor that resumes an enumeration of one namespace’s own keyspace.
- Page
Cursor - One paginated endpoint’s cursor.
Functions§
- decode_
cursor - Decodes a cursor issued by
encode_cursorfor the same endpoint. - decode_
namespace_ cursor - Decodes a cursor issued for
expected_namespace_id’s own keyspace. - encode_
cursor - Encodes a cursor as the opaque string clients round-trip.
- generated_
id - Generates a project-standard opaque durable identifier.
- manifest_
object_ id_ manifest_ id - Logical manifest id encoded in a manifest object id’s 20-digit prefix.
- name_
key_ for_ display_ name - Derives the canonical lookup key for a display name.
- put_
retry_ fingerprint - The fingerprint the original request must have had, if this retry is the same single put with only the content id renamed.
- semantic_
commit_ fingerprint - The semantic identity of one mutation request: what a reused commit id is compared against.
- sha256_
digest - Computes the durable
sha256:digest spelling used by content and envelope references. - wal_
segment_ id_ start_ seq - Start seq encoded in a WAL segment id’s 20-digit position prefix.