pub struct S3Storage { /* private fields */ }Implementations§
Source§impl S3Storage
impl S3Storage
Sourcepub fn new(
config: S3Options,
bucket: String,
prefix: Option<String>,
credentials: S3Credentials,
can_write: bool,
extra_read_headers: Vec<(String, String)>,
extra_write_headers: Vec<(String, String)>,
legacy_rooted_keys: Option<bool>,
) -> Result<S3Storage, ICError<StorageErrorKind>>
pub fn new( config: S3Options, bucket: String, prefix: Option<String>, credentials: S3Credentials, can_write: bool, extra_read_headers: Vec<(String, String)>, extra_write_headers: Vec<(String, String)>, legacy_rooted_keys: Option<bool>, ) -> Result<S3Storage, ICError<StorageErrorKind>>
Build an S3Storage.
extra_read_headers/extra_write_headers are extra HTTP headers injected
by an SDK interceptor and split by HTTP method: GET/HEAD/OPTIONS/TRACE
carry the read headers, everything else the write headers.
legacy_rooted_keys declares the bucket’s key layout:
None— unknown: the layout is auto-detected by probing storage on first use. The right choice when opening a repository whose layout you don’t know.Some(true)— force the legacy leading-slash layout used before the fix for https://github.com/earth-mover/icechunk/issues/2239. Only valid with an empty prefix; errors otherwise.Some(false)— force the standard layout, skipping the probe.
Sourcepub fn unsafe_allow_empty_prefix_creation(self) -> S3Storage
pub fn unsafe_allow_empty_prefix_creation(self) -> S3Storage
Test/internal escape hatch: permit creating a new repository at an empty
prefix (the bucket root), which Storage::can_create_repository would
otherwise refuse.
Sourcepub async fn get_client(&self, settings: &Settings) -> &Arc<Client> ⓘ
pub async fn get_client(&self, settings: &Settings) -> &Arc<Client> ⓘ
Get the client, initializing it if it hasn’t been initialized yet. This is necessary because the client is not serializeable and must be initialized after deserialization. Under normal construction the original client is returned immediately.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for S3Storage
impl<'de> Deserialize<'de> for S3Storage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<S3Storage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<S3Storage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for S3Storage
impl Serialize for S3Storage
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Storage for S3Storage
impl Storage for S3Storage
Source§fn storage_info(&self) -> StorageInfo
fn storage_info(&self) -> StorageInfo
Return structured metadata about this storage backend for display/repr.
fn can_write<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
S3Storage: 'async_trait,
Source§fn can_create_repository<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RepositoryCreation, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
S3Storage: 'async_trait,
fn can_create_repository<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RepositoryCreation, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
S3Storage: 'async_trait,
Whether a repository may be created at this storage location.
fn put_object<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
path: &'life3 str,
bytes: Bytes,
content_type: Option<&'life4 str>,
metadata: Vec<(String, String)>,
previous_version: Option<&'life5 VersionInfo>,
) -> Pin<Box<dyn Future<Output = Result<VersionedUpdateResult, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
S3Storage: 'async_trait,
fn copy_object<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
from: &'life3 str,
to: &'life4 str,
content_type: Option<&'life5 str>,
version: &'life6 VersionInfo,
) -> Pin<Box<dyn Future<Output = Result<VersionedUpdateResult, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
S3Storage: 'async_trait,
Source§fn list_objects<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'a self,
ctx: &'life0 StorageContext<'life1>,
prefix: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ListInfo<String>, ICError<StorageErrorKind>>> + Send + 'a>>, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
S3Storage: 'async_trait,
fn list_objects<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'a self,
ctx: &'life0 StorageContext<'life1>,
prefix: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ListInfo<String>, ICError<StorageErrorKind>>> + Send + 'a>>, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
S3Storage: 'async_trait,
List objects in storage whose keys start with the given prefix. Read more
Source§fn list_objects_with_id_prefixes<'a, 'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'a self,
ctx: &'life0 StorageContext<'life1>,
prefix: &'life2 str,
id_prefixes: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ListInfo<String>, ICError<StorageErrorKind>>> + Send + 'a>>, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
S3Storage: 'async_trait,
fn list_objects_with_id_prefixes<'a, 'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'a self,
ctx: &'life0 StorageContext<'life1>,
prefix: &'life2 str,
id_prefixes: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ListInfo<String>, ICError<StorageErrorKind>>> + Send + 'a>>, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
S3Storage: 'async_trait,
Like
Storage::list_objects, limited to ids that start with one of id_prefixes.
Unordered. Override to list each prefix concurrently; the default filters.Source§fn lists_id_prefixes_natively(&self) -> bool
fn lists_id_prefixes_natively(&self) -> bool
Whether
list_objects_with_id_prefixes lists each prefix on the server
rather than filtering a full listing. Callers fan out only when true.fn delete_batch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
prefix: &'life3 str,
batch: Vec<(String, u64)>,
) -> Pin<Box<dyn Future<Output = Result<DeleteObjectsResult, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
S3Storage: 'async_trait,
fn get_object_last_modified<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
path: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<DateTime<Utc>, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
S3Storage: 'async_trait,
fn get_object_conditional<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
path: &'life3 str,
previous_version: Option<&'life4 VersionInfo>,
) -> Pin<Box<dyn Future<Output = Result<GetModifiedResult, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
S3Storage: 'async_trait,
fn get_object_range<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
path: &'life3 str,
range: Option<&'life4 Range<u64>>,
) -> Pin<Box<dyn Future<Output = Result<(Pin<Box<dyn Stream<Item = Result<Bytes, ICError<StorageErrorKind>>> + Send>>, VersionInfo), ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
S3Storage: 'async_trait,
fn default_settings<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Settings, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn create_location_if_needed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn create_location_if_needed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Ensure the storage location is ready to receive writes. Read more
fn get_object<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
path: &'life3 str,
range: Option<&'life4 Range<u64>>,
) -> Pin<Box<dyn Future<Output = Result<(Pin<Box<dyn AsyncBufRead + Send>>, VersionInfo), ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn get_object_range_read<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
path: &'life3 str,
range: Option<&'life4 Range<u64>>,
) -> Pin<Box<dyn Future<Output = Result<(Pin<Box<dyn AsyncBufRead + Send>>, VersionInfo), ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Source§fn delete_objects<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
prefix: &'life3 str,
ids: Pin<Box<dyn Stream<Item = (String, u64)> + Send + 'life4>>,
) -> Pin<Box<dyn Future<Output = Result<DeleteObjectsResult, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn delete_objects<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
prefix: &'life3 str,
ids: Pin<Box<dyn Stream<Item = (String, u64)> + Send + 'life4>>,
) -> Pin<Box<dyn Future<Output = Result<DeleteObjectsResult, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Delete a stream of objects, by their id string representations
Input stream includes sizes to get as result the total number of bytes deleted
fn root_is_clean<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<bool, ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn get_object_concurrently_multiple<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
key: &'life3 str,
parts: Vec<Range<u64>>,
) -> Pin<Box<dyn Future<Output = Result<(Pin<Box<dyn AsyncBufRead + Send>>, VersionInfo), ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn get_object_concurrently<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
ctx: &'life1 StorageContext<'life2>,
key: &'life3 str,
range: &'life4 Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<(Pin<Box<dyn AsyncBufRead + Send>>, VersionInfo), ICError<StorageErrorKind>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl !Freeze for S3Storage
impl !RefUnwindSafe for S3Storage
impl !UnwindSafe for S3Storage
impl Send for S3Storage
impl Sync for S3Storage
impl Unpin for S3Storage
impl UnsafeUnpin for S3Storage
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.