pub struct S3Backend { /* private fields */ }Implementations§
Source§impl S3Backend
impl S3Backend
pub fn new( client: Client, bucket: impl Into<String>, key_prefix: impl Into<String>, partition_id: PartitionId, ) -> Self
Sourcepub async fn presigned_put_url(
&self,
hash: &Hash,
expires_in: Duration,
) -> Result<String, StorageError>
pub async fn presigned_put_url( &self, hash: &Hash, expires_in: Duration, ) -> Result<String, StorageError>
Presigned PUT URL for direct-to-bucket client upload of hash’s
content. The caller is responsible for encoding the body the same
way S3Backend::put would ([codec_byte][payload]) if it needs
to be readable by this backend’s get() — for a purely
client-driven upload flow, prefer generating the URL for a raw
object and let the server-side ingest path (not this backend) do
the codec framing on confirmation.
pub async fn presigned_get_url( &self, hash: &Hash, expires_in: Duration, ) -> Result<String, StorageError>
Trait Implementations§
Source§impl AsyncImmutableStore for S3Backend
impl AsyncImmutableStore for S3Backend
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch and verify content by hash. Implementations MUST verify the
returned bytes hash to
hash before returning Ok.Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Hash, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Hash, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store
data, returning its content hash. A put for content
already present is a no-op dedup hit, not a duplicate write.fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn partition_id(&self) -> PartitionId
Auto Trait Implementations§
impl !RefUnwindSafe for S3Backend
impl !UnwindSafe for S3Backend
impl Forget for S3Backend
impl Freeze for S3Backend
impl Move for S3Backend
impl Send for S3Backend
impl Sync for S3Backend
impl Unpin for S3Backend
impl UnsafeUnpin for S3Backend
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 moreCreates a shared type from an unshared type.