pub struct LocalBlobStore { /* private fields */ }Expand description
Filesystem-backed BlobStore rooted at a directory.
Single-node. Writes are durable-on-return: each put / put_chunks:
- write a temp file in the same directory as the final key
std::fs::File::sync_data(fdatasync on Unix) so payload bytes are durablerenameinto placefsyncthe parent directory so the directory entry survives power loss
(On macOS, true device durability may need F_FULLFSYNC; Linux sync_data /
dir sync_all is the intended contract.)
Implementations§
Trait Implementations§
Source§impl BlobStore for LocalBlobStore
impl BlobStore for LocalBlobStore
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Durably store
value at key (see the trait-level durability note).
value may be arbitrarily large; a network adapter should chunk it
(e.g. S3 multipart) rather than rely on a single request.Source§fn put_chunks<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
chunks: Vec<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_chunks<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
chunks: Vec<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Durably store a logical object assembled from immutable byte chunks. Read more
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch the whole object at
key, or None if absent.Source§fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a byte sub-range of an object without fetching the whole thing.
None if the key is absent. range.end > len or range.start > range.end
is ObjectLogError::RangeOutOfBounds; an empty n..n returns
Ok(Some(<empty>)). No integrity check is performed — payloads are opaque.Source§fn get_range_exact<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_range_exact<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Strict physical range allocation contract. Caller pre-admits requested
bytes. Must never fetch a whole object or buffer more than this range.
Bounds accumulated payload; transport chunks/headers require extra scratch.
Local blocking reads can outlive cancellation: the operation owner must
retain admission until physical completion. Unknown adapters fail closed;
legacy get_range remains compatible.
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List keys beginning with
prefix.Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete an object; deleting a missing key is a no-op success.
Source§fn compare_and_swap<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
expected: Option<Bytes>,
new_value: Bytes,
) -> Pin<Box<dyn Future<Output = Result<CasOutcome, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compare_and_swap<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
expected: Option<Bytes>,
new_value: Bytes,
) -> Pin<Box<dyn Future<Output = Result<CasOutcome, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn take_media_op_stats(&self) -> Option<MediaOpStats>
fn take_media_op_stats(&self) -> Option<MediaOpStats>
Snapshot and reset media-op counters since the previous take. Read more
Source§impl BoundedMetadataStore for LocalBlobStore
impl BoundedMetadataStore for LocalBlobStore
Source§fn read_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
limits: MetadataLimits,
owners: MetadataOwners,
) -> Pin<Box<dyn Future<Output = Result<MetadataSnapshot, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
limits: MetadataLimits,
owners: MetadataOwners,
) -> Pin<Box<dyn Future<Output = Result<MetadataSnapshot, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read one complete object within the admitted bound, with an opaque CAS
token. Oversize/malformed responses fail before whole-body collection.
Source§fn swap_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
observed: MetadataSnapshot,
new_value: Bytes,
limits: MetadataLimits,
owners: MetadataOwners,
) -> Pin<Box<dyn Future<Output = Result<MetadataSwap, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn swap_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
observed: MetadataSnapshot,
new_value: Bytes,
limits: MetadataLimits,
owners: MetadataOwners,
) -> Pin<Box<dyn Future<Output = Result<MetadataSwap, ObjectLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Conditional durable replacement of exactly the observed provider/key/
version. No automatic conditional-write retry. Oversized input is rejected
before I/O; failed conflict rereads are errors, never definite rejection.
Auto Trait Implementations§
impl Forget for LocalBlobStore
impl Freeze for LocalBlobStore
impl RefUnwindSafe for LocalBlobStore
impl Send for LocalBlobStore
impl Sync for LocalBlobStore
impl Unpin for LocalBlobStore
impl UnsafeUnpin for LocalBlobStore
impl UnwindSafe for LocalBlobStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more