pub struct CompressedBucketStore { /* private fields */ }Implementations§
Source§impl CompressedBucketStore
impl CompressedBucketStore
pub fn new(inner: Arc<dyn BucketStore>, level: u32) -> Self
pub fn with_max_decompressed_size(self, limit: usize) -> Self
Trait Implementations§
Source§impl BucketStore for CompressedBucketStore
impl BucketStore for CompressedBucketStore
Source§fn prefix(&self) -> &str
fn prefix(&self) -> &str
The bucket prefix this store is scoped to (e.g. “my-app/db1”).
Each prefix has exactly one owner — see module docs.
Source§fn writer_id(&self) -> &str
fn writer_id(&self) -> &str
Identity of this writer. Stored in writer.json in the bucket.
Verified on open and every background loop iteration.
If another server tries to use this prefix, they get Error::WrongWriter.
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<()>> + 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>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_with_etag<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(Bytes, String)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_with_etag<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(Bytes, String)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Internal: get object data and its ETag. Used to populate manifest.etag
after reading the manifest from bucket. Read more
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + 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<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn put_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stream a local file to object storage. Avoids loading the entire file
into memory, making it safe for large database snapshots.
Source§fn get_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
dest: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<PathBuf>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
dest: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<PathBuf>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stream from object storage directly to a local file. Avoids loading
the entire object into memory. Returns the file path on success.
Source§fn put_if_match<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
data: Bytes,
etag: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_if_match<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
data: Bytes,
etag: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Put data with an ETag precondition. Fails with
PreconditionFailed if the
object’s current ETag does not match etag. This enables optimistic
concurrency control for manifest writes.Source§fn put_if_not_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_if_not_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Atomically create an object only if it does not already exist.
Returns
Ok(()) if created, Err(Error::PreconditionFailed) if already exists.
This is the key primitive for acquiring distributed locks.Auto Trait Implementations§
impl !RefUnwindSafe for CompressedBucketStore
impl !UnwindSafe for CompressedBucketStore
impl Forget for CompressedBucketStore
impl Freeze for CompressedBucketStore
impl Move for CompressedBucketStore
impl Send for CompressedBucketStore
impl Sync for CompressedBucketStore
impl Unpin for CompressedBucketStore
impl UnsafeUnpin for CompressedBucketStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more