loonfs-api 0.3.1

Wire types and durable-format codecs for LoonFS.
Documentation
//! Wire types and durable-format codecs for LoonFS.
//!
//! The crate defines validated identifiers and paths, HTTP protocol shapes in
//! [`v0`], durable storage formats in [`wire`], and shared operation options in
//! [`options`].

#![warn(missing_docs)]

mod access;
mod actor;
mod attributes;
mod base64_bytes;
mod capability;
mod commit_identity;
mod content;
mod control;
mod digest;
pub mod env;
mod envelope;
mod error;
mod hex;
mod ids;
mod manifest;
mod name_policy;
pub mod options;
mod pagination;
mod path;
pub mod public_inode_id;
mod retry;
mod secret;
mod sst_blocks;
pub mod v0;
mod wal;

pub mod wire {
    //! Durable wire formats grouped by their owning format family.

    pub mod hex {
        //! Lowercase hexadecimal primitives shared by durable codecs.

        pub use crate::hex::*;
    }

    pub mod manifest {
        //! Namespace-manifest envelopes, rows, and key constructors.

        pub use crate::manifest::*;
    }

    pub mod control {
        //! Mutable namespace control-object envelopes and payloads.

        pub use crate::control::*;
    }

    pub mod envelope {
        //! Shared durable envelope codec and validation errors.

        pub use crate::envelope::*;
    }

    pub mod sst_blocks {
        //! Block handles, builders, and codecs for metadata and index segments.

        pub use crate::sst_blocks::*;
    }

    pub mod wal {
        //! WAL segment envelopes, records, and codecs.

        pub use crate::wal::*;
    }
}

pub use access::{
    AccessGrants, AccessGrantsError, AccessRevisionNo, AccessRight, AccessRights, PrincipalId,
    PrincipalIdValidationError, PrincipalScope, PrincipalScopeValidationError, PrincipalSet,
    PrincipalSetError, Subject, SubjectId, SubjectIdValidationError,
    MAX_ACCESS_GRANTS_PRINCIPAL_BYTES, MAX_ACCESS_GRANT_ENTRIES, MAX_SUBJECT_PRINCIPALS,
};
pub use actor::{ActorId, ActorIdValidationError};
pub use attributes::{
    AttributeKey, AttributeKeyValidationError, AttributeRevisionNo, AttributeValue,
    AttributeValueValidationError, Attributes, AttributesError, MAX_ATTRIBUTES_TOTAL_BYTES,
    MAX_ATTRIBUTE_ENTRIES, MAX_ATTRIBUTE_KEY_BYTES, MAX_ATTRIBUTE_VALUE_BYTES,
    RESERVED_ATTRIBUTE_KEY_PREFIX,
};
pub use capability::{
    CapabilityDocument, CapabilityDocumentError, ALL_LIMIT_KEYS, API_GROUP_FILESYSTEM_V0,
    API_GROUP_MAINTENANCE_V0, API_GROUP_QUERY_V0, FEATURE_ATTRIBUTES,
    FEATURE_COMMIT_INLINE_CONTENT, FEATURE_DOWNLOADS_DIRECT_GET, FEATURE_INODES_LIST_CHILDREN,
    FEATURE_MAINTENANCE_GREP_INDEX, FEATURE_NAMESPACES_CREATE, FEATURE_NAMESPACES_DELETE,
    FEATURE_NAMESPACES_FORK, FEATURE_QUERY_GREP, FEATURE_SNAPSHOTS,
    FEATURE_UPLOADS_DIRECT_MULTIPART, FEATURE_UPLOADS_DIRECT_PUT, LIMIT_ACCESS_MAX_PRINCIPALS,
    LIMIT_COMMIT_MAX_CONTENT_TOKENS, LIMIT_COMMIT_MAX_EXTERNAL_CONTENT_REFS,
    LIMIT_COMMIT_MAX_INLINE_CONTENT_BYTES, LIMIT_COMMIT_MAX_MESSAGE_BYTES,
    LIMIT_COMMIT_MAX_OPERATIONS, LIMIT_COMMIT_MAX_PRECONDITIONS, LIMIT_DOWNLOAD_MAX_CONCURRENT,
    LIMIT_DOWNLOAD_MAX_CONTENT_BYTES, LIMIT_GC_MIN_GRACE_WINDOW_MS, LIMIT_PAGINATION_DEFAULT,
    LIMIT_PAGINATION_MAX, LIMIT_QUERY_GREP_DEFAULT, LIMIT_QUERY_GREP_MAX,
    LIMIT_QUERY_GREP_SCAN_BUDGET_FILES, LIMIT_QUERY_GREP_TAIL_BUDGET_FILES,
    LIMIT_SNAPSHOT_MAX_LIFETIME_MS, LIMIT_SNAPSHOT_MAX_LIVE_PER_NAMESPACE,
    LIMIT_SNAPSHOT_MAX_TTL_MS, LIMIT_UPLOAD_COMPLETION_MAX_BODY_BYTES,
    LIMIT_UPLOAD_DIRECT_PUT_MAX_CONTENT_BYTES, LIMIT_UPLOAD_MAX_CONCURRENT,
    LIMIT_UPLOAD_MAX_CONTENT_BYTES, PROTOCOL_VERSION,
};
pub use commit_identity::{
    semantic_commit_fingerprint, CommitFingerprint, SemanticFingerprintError,
};
pub use content::{
    Checksum, ChecksumAlgorithm, ChecksumValidationError, ContentRef, ContentRefKind,
    ContentRefValidationError, Crc32c, Crc64Nvme, Sha256, StreamingChecksum,
};
pub use digest::sha256_digest;
pub use error::{ErrorCode, ErrorKind};
pub use ids::{
    generated_id, next_public_ordinal, BindingGeneration, BindingGenerationValidationError,
    ChangeSeq, CheckpointId, CommitId, CommitIdValidationError, ContentId, ContentStoreId,
    GeneratedIdValidationError, IndexSegmentId, InodeId, InodeKind, ManifestNo,
    MetadataCompactionId, MetadataSegmentId, NameKey, NameKeyValidationError, NamespaceId,
    NamespaceIdValidationError, PublicOrdinalRangeError, RevisionNo, RunNo, SnapshotId,
    SnapshotIdValidationError, UploadId, WalNo, WriterEpoch, WriterId, WriterIdValidationError,
    FIRST_ALLOCATABLE_INODE_ID, MAX_ID_BYTES, MAX_NAME_KEY_BYTES, MAX_PUBLIC_INTEGER,
    ROOT_INODE_ID,
};
pub use manifest::{MetadataFamilyGroup, NamespaceAccess};
pub use name_policy::name_key_for_display_name;
pub use options::AttributeInclusion;
pub use pagination::{
    decode_cursor, decode_namespace_cursor, decode_token, encode_cursor, encode_token,
    DirectoryPageCursor, EffectiveLimit, FileRevisionsPageCursor, GrepPageCursor, LimitError,
    NamespaceCursor, NamespaceCursorError, OpaqueToken, OpaqueTokenError, Page, PageCursor,
    PageCursorError, PageRequest, PagedResponse, Pager, PaginationPolicy, TrashPageCursor,
    DEFAULT_MAX_PAGE_LIMIT, DEFAULT_PAGE_LIMIT, PAGE_CURSOR_FORMAT_VERSION,
};
pub use path::{
    AbsolutePath, DisplayName, PathComponent, PathError, MAX_DISPLAY_NAME_BYTES, MAX_PATH_BYTES,
    MAX_PATH_DEPTH,
};
pub use retry::{
    transport_retry_backoff, MonotonicTimer, OperationDeadline, StdMonotonicTimer,
    TransportRetryPolicy,
};
pub use secret::SecretString;

// Curated root re-exports of the common v0 HTTP surface. v0 HTTP shapes live
// in `v0`; add here only what most consumers touch.
pub use v0::{
    AdvanceRetentionRequest, AdvanceRetentionResponse, ApiError, AttributesProjection, Checkpoint,
    CheckpointOwnerSummary, Commit, CommitPrecondition, CommitRequest, CreateCheckpointRequest,
    CreateNamespaceRequest, CreateSnapshotRequest, DeleteCheckpointResponse,
    DeleteDirectoryBehavior, DeleteNamespaceResponse, DeleteSnapshotResponse,
    DeletedCheckpointsByOwner, DeletedObjectCounts, DestinationBehavior, DestinationPrecondition,
    DestinationPreconditionError, ErrorDetails, ExpectedFileState, ExtendSnapshotRequest,
    FileBytes, FileRevision, FilesystemOperation, FlushWalOutcome, FlushWalResponse,
    ForkNamespaceRequest, GcRequest, GcResponse, GrepMatch, GrepRequest, GrepResponse,
    ListCheckpointsResponse, ListFileRevisionsResponse, ListInodeChildrenResponse,
    ListPathEntriesResponse, ListSnapshotsResponse, ListTrashResponse, MetadataCompactionOutcome,
    MetadataCompactionRequest, MetadataCompactionResponse, MetadataMaintenanceRequest,
    MetadataMaintenanceResponse, Namespace, NamespaceAccessMode, NamespaceDiagnostics,
    NamespaceForkBasis, PathEntry, PathEntryKind, PreconditionFields, RecoverAdministratorRequest,
    RecoverAdministratorResponse, ReorganizeStepOutcome, RetainedCandidates, RetainedReason,
    RunMaintenanceRequest, RunMaintenanceResponse, SnapshotSummary, TrashEntry,
    WalFlushStepOutcome,
};