Skip to main content

Module storage

Module storage 

Available on crate feature inspect only.
Expand description

Streaming record storage. Logical identifiers never expose filesystem offsets.

An append publishes exactly one complete record. Dropping its future may leave backend work in flight, but it must not publish a partial record or damage a previous record. A backend must recover before accepting the next append. These are visibility guarantees, not promises of crash durability.

Structs§

Collection
An owned collection. Dropping its last capability or reader releases its storage. Read handles pin their underlying data independently of registry eviction.
CollectionReader
Read-only access to a collection, independent of append serialization. Both this handle and its readers retain the underlying storage.
CollectionWriter
Append access to a collection. Keep this capability behind a lock when publication of application indexes must remain ordered with storage writes.
CreateCollection
Create a collection with an application-assigned, instance-unique identifier.
FileStore
Temporary filesystem storage, using Rama’s private-directory and cleanup helpers. Each collection has its own file and append lock. Idle committed collections keep no file descriptor. At most 64 appends perform I/O concurrently; reads pin independent descriptors. Cancelled appends settle and release their descriptor in a background recovery task, retaining their admission permit until then. Dropping an append outside a Tokio runtime can retain its unsettled handle without a permit until the next append or collection drop. Runtime shutdown can likewise interrupt recovery, so the concurrency bound is not a descriptor limit for collections retained across runtime shutdown.
ListRecords
Snapshot the identifiers of currently committed records.
MemoryStore
Bounded memory storage. Open readers keep evicted data and its budget alive.
ReadRecord
Read a committed record or a range of its logical bytes. The end is exclusive; bounds beyond EOF clamp to the record length, and reversed ranges are rejected. Memory and file storage address ranges directly. Streaming layers such as encryption may need to consume the preceding bytes; see the layer’s contract.
RecordId
Logical record identifier within a collection. Never a byte offset.
StorageLimits
Storage admission limits, shared across collections. Defaults bound retained bytes to 64 MiB and each record to 8 MiB. Explicit zero fields mean unlimited. Counts logical record bytes, not backing-allocation capacity or index memory; protocol adapters should also bound their retained record count.

Enums§

AppendRecord
Append an owned stream. Success publishes the record; cancellation aborts it.

Functions§

range_reader
Select a range from a streaming reader without buffering its contents. A non-zero start consumes the prefix; seekable backends should address it directly. Bounds beyond EOF clamp to the content length; errors while reading the prefix still propagate, including errors from an authenticating storage layer.

Type Aliases§

Reader
An owned reader, suitable for streaming to a response, file, or native UI.
Storage
Erase the storage implementation only at the composition boundary.