Skip to main content

loonfs_api/
lib.rs

1//! Wire types and durable-format codecs for LoonFS.
2//!
3//! The crate defines validated identifiers and paths, HTTP protocol shapes in
4//! [`v0`], durable storage formats in [`wire`], and shared operation options in
5//! [`options`].
6
7#![warn(missing_docs)]
8
9mod actor;
10mod attributes;
11mod capability;
12mod commit_identity;
13mod content;
14mod control;
15mod digest;
16pub mod env;
17mod envelope;
18mod error;
19mod hex;
20mod ids;
21mod manifest;
22mod name_policy;
23pub mod options;
24mod pagination;
25mod path;
26pub mod public_inode_id;
27mod secret;
28mod sst_blocks;
29pub mod v0;
30mod wal;
31
32pub mod wire {
33    //! Durable wire formats grouped by their owning format family.
34
35    pub mod hex {
36        //! Lowercase hexadecimal primitives shared by durable codecs.
37
38        pub use crate::hex::*;
39    }
40
41    pub mod manifest {
42        //! Namespace-manifest envelopes, rows, and key constructors.
43
44        pub use crate::manifest::*;
45    }
46
47    pub mod control {
48        //! Mutable namespace control-object envelopes and payloads.
49
50        pub use crate::control::*;
51    }
52
53    pub mod envelope {
54        //! Shared durable envelope codec and validation errors.
55
56        pub use crate::envelope::*;
57    }
58
59    pub mod sst_blocks {
60        //! Block handles, builders, and codecs for metadata and index segments.
61
62        pub use crate::sst_blocks::*;
63    }
64
65    pub mod wal {
66        //! WAL segment envelopes, records, and codecs.
67
68        pub use crate::wal::*;
69    }
70}
71
72pub use actor::{ActorId, ActorIdValidationError, ActorKind, ActorRef};
73pub use attributes::{
74    AttributeKey, AttributeKeyValidationError, AttributeRevisionNo, AttributeValue,
75    AttributeValueValidationError, Attributes, AttributesError, MAX_ATTRIBUTES_TOTAL_BYTES,
76    MAX_ATTRIBUTE_ENTRIES, MAX_ATTRIBUTE_KEY_BYTES, MAX_ATTRIBUTE_VALUE_BYTES,
77    RESERVED_ATTRIBUTE_KEY_PREFIX,
78};
79pub use capability::{
80    CapabilityDocument, CapabilityDocumentError, FEATURE_ADMIN_GREP_INDEX, FEATURE_ATTRIBUTES,
81    FEATURE_DOWNLOADS_DIRECT_GET, FEATURE_INODES_LIST_CHILDREN, FEATURE_NAMESPACES_CREATE,
82    FEATURE_NAMESPACES_DELETE, FEATURE_NAMESPACES_FORK, FEATURE_QUERY_GREP, FEATURE_SNAPSHOTS,
83    FEATURE_UPLOADS_DIRECT_MULTIPART, FEATURE_UPLOADS_DIRECT_PUT, LIMIT_COMMIT_MAX_CONTENT_TOKENS,
84    LIMIT_COMMIT_MAX_EXTERNAL_CONTENT_REFS, LIMIT_COMMIT_MAX_MESSAGE_BYTES,
85    LIMIT_COMMIT_MAX_OPERATIONS, LIMIT_DOWNLOAD_MAX_CONCURRENT, LIMIT_DOWNLOAD_MAX_CONTENT_BYTES,
86    LIMIT_GC_MIN_GRACE_WINDOW_MS, LIMIT_PAGINATION_DEFAULT, LIMIT_PAGINATION_MAX,
87    LIMIT_QUERY_GREP_DEFAULT, LIMIT_QUERY_GREP_MAX, LIMIT_QUERY_GREP_SCAN_BUDGET_FILES,
88    LIMIT_QUERY_GREP_TAIL_BUDGET_FILES, LIMIT_SNAPSHOT_MAX_LIFETIME_MS,
89    LIMIT_SNAPSHOT_MAX_LIVE_PER_NAMESPACE, LIMIT_SNAPSHOT_MAX_TTL_MS,
90    LIMIT_UPLOAD_COMPLETION_MAX_BODY_BYTES, LIMIT_UPLOAD_DIRECT_PUT_MAX_CONTENT_BYTES,
91    LIMIT_UPLOAD_MAX_CONCURRENT, LIMIT_UPLOAD_MAX_CONTENT_BYTES, PROFILE_ADMIN_V0, PROFILE_CORE_V0,
92    PROFILE_QUERY_V0, PROTOCOL_VERSION,
93};
94pub use commit_identity::{
95    put_retry_fingerprint, reconcile_put_commit_id_reuse, semantic_commit_fingerprint,
96    PutRetryAttempt, PutRetryErrorClassification, PutRetryReceipt, SemanticFingerprintError,
97};
98pub use content::{
99    Checksum, ChecksumAlgorithm, ChecksumValidationError, ContentEvidence, ContentRef,
100    ContentRefKind, ContentRefValidationError, Crc32c, Crc64Nvme, Sha256, StreamingChecksum,
101};
102pub use digest::sha256_digest;
103pub use error::{ErrorCode, ErrorKind};
104pub use ids::{
105    generated_id, manifest_object_id_manifest_no, next_public_ordinal, wal_segment_id_start_seq,
106    ChangeSeq, CheckpointId, CommitId, CommitIdValidationError, ContentId, ContentStoreId,
107    GeneratedIdValidationError, GrepManifestObjectId, IndexSegmentId, InodeId, InodeKind,
108    ManifestNo, ManifestObjectId, MetadataCompactionId, MetadataSegmentId, NameKey,
109    NameKeyValidationError, NamespaceId, NamespaceIdValidationError, PublicOrdinalRangeError,
110    RevisionNo, RunNo, UploadId, WalSegmentId, WriterEpoch, FIRST_ALLOCATABLE_INODE_ID,
111    MAX_ID_BYTES, MAX_NAME_KEY_BYTES, MAX_PUBLIC_INTEGER, ROOT_INODE_ID,
112};
113pub use name_policy::name_key_for_display_name;
114pub use pagination::{
115    decode_cursor, decode_namespace_cursor, encode_cursor, DirectoryPageCursor, EffectiveLimit,
116    FileRevisionsPageCursor, GrepPageCursor, LimitError, NamespaceCursor, NamespaceCursorError,
117    Page, PageCursor, PageCursorError, PageRequest, PaginationPolicy, TrashPageCursor,
118    DEFAULT_MAX_PAGE_LIMIT, DEFAULT_PAGE_LIMIT, PAGE_CURSOR_FORMAT_VERSION,
119};
120pub use path::{
121    AbsolutePath, DisplayName, PathComponent, PathError, MAX_DISPLAY_NAME_BYTES, MAX_PATH_BYTES,
122    MAX_PATH_DEPTH,
123};
124pub use secret::SecretString;
125
126// Curated root re-exports of the common v0 HTTP surface. v0 HTTP shapes live
127// in `v0`; add here only what most consumers touch.
128pub use v0::{
129    AdvanceRetentionRequest, AdvanceRetentionResponse, ApiError, AttributesProjection, Checkpoint,
130    CheckpointOwnerSummary, CommitRequest, CommitResponse, CreateCheckpointRequest,
131    CreateNamespaceRequest, CreateSnapshotRequest, DeleteDirectoryBehavior,
132    DeleteNamespaceResponse, DeletedObjectCounts, DestinationBehavior, ErrorDetails,
133    ExtendSnapshotRequest, FileBytes, FileRevision, FilesystemOperation, FlushWalOutcome,
134    FlushWalResponse, ForkNamespaceRequest, GcRequest, GcResponse, GrepMatch, GrepRequest,
135    GrepResponse, ListCheckpointsResponse, ListFileRevisionsResponse, ListInodeChildrenResponse,
136    ListPathEntriesResponse, ListSnapshotsResponse, ListTrashResponse, MaintenanceStepRequest,
137    MaintenanceStepResponse, MetadataMaintenanceRequest, MetadataMaintenanceResponse, Namespace,
138    NamespaceDiagnostics, PathEntry, PathEntryKind, ReleaseCheckpointResponse,
139    ReleaseSnapshotResponse, ReleasedCheckpointCounts, ReorganizeStepOutcome, RetainedCandidates,
140    RetainedReason, SnapshotSummary, TrashEntry, WalFlushStepOutcome,
141};