Skip to main content

S3Storage

Struct S3Storage 

Source
pub struct S3Storage { /* private fields */ }

Implementations§

Source§

impl S3Storage

Source

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.
Source

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.

Source

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 Debug for S3Storage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for S3Storage

Source§

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 Display for S3Storage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Serialize for S3Storage

Source§

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

Source§

fn storage_info(&self) -> StorageInfo

Return structured metadata about this storage backend for display/repr.
Source§

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,

Whether a repository may be created at this storage location.
Source§

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,

Source§

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,

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,

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

Whether list_objects_with_id_prefixes lists each prefix on the server rather than filtering a full listing. Callers fan out only when true.
Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Ensure the storage location is ready to receive writes. Read more
Source§

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,

Source§

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,

Delete a stream of objects, by their id string representations Input stream includes sizes to get as result the total number of bytes deleted
Source§

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,

Source§

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,

Source§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more