pub struct S3Store { /* private fields */ }Expand description
Production ObjectStore backed by aws-sdk-s3.
Implementations§
Source§impl S3Store
impl S3Store
Sourcepub async fn from_remote_url(url: &RemoteUrl) -> Result<Self, ObjectStoreError>
pub async fn from_remote_url(url: &RemoteUrl) -> Result<Self, ObjectStoreError>
Build an S3Store from a parsed RemoteUrl.
The RemoteUrl::S3::prefix field is intentionally not
consumed here; callers compose it into keys themselves per the
module-level docs.
§Errors
Returns ObjectStoreError::Other if url is not the S3 variant
or if the endpoint URL cannot be normalised for virtual-hosted
addressing.
Trait Implementations§
Source§impl ObjectStore for S3Store
impl ObjectStore for S3Store
Source§fn get_bytes_range<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_bytes_range<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Issue a GetObject with a Range: bytes=<start>-<end-1> header.
HTTP 416 maps to ObjectStoreError::RangeNotSatisfiable with
the original requested range (so the wire-line names what the
caller asked for, not the server’s translation). All other
failures route through [classify].
S3 silently truncates a ranged GET to EOF when the requested
range overruns the object — start < body.len() <= end returns
start..body.len() bytes with HTTP 206 and no error. The
post-flight length check via [super::verify_range_response_length]
elevates that mismatch to ObjectStoreError::RangeNotSatisfiable
so callers (notably the packchain reader) cannot mistake a
truncated slice for the full requested range.
Source§fn presigned_get_url<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<String, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn presigned_get_url<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<String, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Presign a GetObject request for key valid for ttl. Used
by the bundle-uri capability (issue #76) to advertise
time-limited download URLs against private buckets. The
returned URL carries an X-Amz-Signature query parameter
derived from the SDK’s resolved SigV4 credentials and an
X-Amz-Expires=<ttl-seconds> parameter that the operator
can use to verify the requested TTL was honoured.
§Errors
Returns ObjectStoreError::Other when the SDK rejects the
TTL (AWS caps presigned URLs at 7 days) or when the
presigning step fails (e.g. credential provider returned no
credentials).
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectMeta>, ObjectStoreError>> + 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<ObjectMeta>, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
prefix as a byte prefix.Source§fn get_to_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
dest: &'life2 Path,
opts: GetOpts,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_to_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
dest: &'life2 Path,
opts: GetOpts,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
dest. The destination’s parent
directory must already exist. opts.progress, when set, fires
at chunk boundaries with the count of bytes just received.Source§fn get_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Bytes, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Bytes, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn put_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
body: Bytes,
opts: PutOpts,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
body: Bytes,
opts: PutOpts,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
body to key, overwriting any existing object.Source§fn put_path<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
src: &'life2 Path,
opts: PutOpts,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_path<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
src: &'life2 Path,
opts: PutOpts,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
key, overwriting any existing object. Read moreSource§fn put_if_absent<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
body: Bytes,
) -> Pin<Box<dyn Future<Output = Result<bool, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_if_absent<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
body: Bytes,
) -> Pin<Box<dyn Future<Output = Result<bool, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
key if and only if it does not exist. Returns Ok(true)
when the object was created, Ok(false) when the key was already
present.Source§fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ObjectMeta, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ObjectMeta, ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
src: &'life1 str,
dst: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
src: &'life1 str,
dst: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
src to dst. The body is preserved on every backend;
user metadata is not guaranteed to survive — callers must not
rely on metadata round-tripping through copy. Read moreSource§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ObjectStoreError>> + 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<(), ObjectStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
key. Returns Err(ObjectStoreError::NotFound) if the key was
not present.Auto Trait Implementations§
impl Freeze for S3Store
impl !RefUnwindSafe for S3Store
impl Send for S3Store
impl Sync for S3Store
impl Unpin for S3Store
impl UnsafeUnpin for S3Store
impl !UnwindSafe for S3Store
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
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>
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>
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