ObjectStorage

Struct ObjectStorage 

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

Implementations§

Source§

impl ObjectStorage

Source

pub async fn new_in_memory() -> Result<ObjectStorage, StorageError>

Create an in memory Storage implementation

This implementation should not be used in production code.

Source

pub async fn new_local_filesystem( prefix: &StdPath, ) -> Result<ObjectStorage, StorageError>

Create an local filesystem Storage implementation

This implementation should not be used in production code.

Source

pub async fn new_s3( bucket: String, prefix: Option<String>, credentials: Option<S3Credentials>, config: Option<S3Options>, ) -> Result<ObjectStorage, StorageError>

Source

pub async fn new_azure( account: String, container: String, prefix: Option<String>, credentials: Option<AzureCredentials>, config: Option<HashMap<AzureConfigKey, String>>, ) -> Result<ObjectStorage, StorageError>

Source

pub async fn new_gcs( bucket: String, prefix: Option<String>, credentials: Option<GcsCredentials>, config: Option<HashMap<GoogleConfigKey, String>>, ) -> Result<ObjectStorage, StorageError>

Source

pub fn artificially_sort_refs_in_mem(&self) -> bool

We need this because object_store’s local file implementation doesn’t sort refs. Since this implementation is used only for tests, it’s OK to sort in memory.

Source

pub async fn all_keys(&self) -> StorageResult<Vec<String>>

Return all keys in the store

Intended for testing and debugging purposes only.

Trait Implementations§

Source§

impl Debug for ObjectStorage

Source§

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

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

impl<'de> Deserialize<'de> for ObjectStorage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ObjectStorage

Source§

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

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

impl Serialize for ObjectStorage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Storage for ObjectStorage

Source§

fn can_write(&self) -> bool

Source§

fn default_settings(&self) -> Settings

Source§

fn fetch_config<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, ) -> Pin<Box<dyn Future<Output = StorageResult<FetchConfigResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn update_config<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, config: Bytes, previous_version: &'life2 VersionInfo, ) -> Pin<Box<dyn Future<Output = StorageResult<UpdateConfigResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn fetch_snapshot<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, id: &'life2 SnapshotId, ) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn AsyncRead + Unpin + Send>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn fetch_manifest_known_size<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, id: &'life2 ManifestId, size: u64, ) -> Pin<Box<dyn Future<Output = StorageResult<Reader>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns whatever reader is more efficient. Read more
Source§

fn fetch_manifest_unknown_size<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, id: &'life2 ManifestId, ) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn AsyncRead + Unpin + Send>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn fetch_transaction_log<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, id: &'life2 SnapshotId, ) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn AsyncRead + Unpin + Send>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn write_snapshot<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, id: SnapshotId, metadata: Vec<(String, String)>, bytes: Bytes, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn write_manifest<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, id: ManifestId, metadata: Vec<(String, String)>, bytes: Bytes, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn write_transaction_log<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, id: SnapshotId, metadata: Vec<(String, String)>, bytes: Bytes, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn fetch_chunk<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, settings: &'life1 Settings, id: &'life2 ChunkId, range: &'life3 Range<ChunkOffset>, ) -> Pin<Box<dyn Future<Output = Result<Bytes, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn write_chunk<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, id: ChunkId, bytes: Bytes, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_ref<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, ref_key: &'life2 str, ) -> Pin<Box<dyn Future<Output = StorageResult<GetRefResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn ref_names<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, ) -> Pin<Box<dyn Future<Output = StorageResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn write_ref<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, settings: &'life1 Settings, ref_key: &'life2 str, bytes: Bytes, previous_version: &'life3 VersionInfo, ) -> Pin<Box<dyn Future<Output = StorageResult<WriteRefResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn list_objects<'a, 'life0, 'life1, 'async_trait>( &'a self, settings: &'life0 Settings, prefix: &'life1 str, ) -> Pin<Box<dyn Future<Output = StorageResult<BoxStream<'a, StorageResult<ListInfo<String>>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn delete_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, prefix: &'life2 str, batch: Vec<(String, u64)>, ) -> Pin<Box<dyn Future<Output = StorageResult<DeleteObjectsResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn get_snapshot_last_modified<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, snapshot: &'life2 SnapshotId, ) -> Pin<Box<dyn Future<Output = StorageResult<DateTime<Utc>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn get_object_range_buf<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, settings: &'life1 Settings, key: &'life2 str, range: &'life3 Range<u64>, ) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn Buf + Unpin + Send>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn get_object_range_read<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, settings: &'life1 Settings, key: &'life2 str, range: &'life3 Range<u64>, ) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn AsyncRead + Unpin + Send>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn delete_objects<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, settings: &'life1 Settings, prefix: &'life2 str, ids: BoxStream<'life3, (String, u64)>, ) -> Pin<Box<dyn Future<Output = StorageResult<DeleteObjectsResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: '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, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_chunks<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, ) -> Pin<Box<dyn Future<Output = StorageResult<BoxStream<'_, StorageResult<ListInfo<ChunkId>>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn list_manifests<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, ) -> Pin<Box<dyn Future<Output = StorageResult<BoxStream<'_, StorageResult<ListInfo<ManifestId>>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn list_snapshots<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, ) -> Pin<Box<dyn Future<Output = StorageResult<BoxStream<'_, StorageResult<ListInfo<SnapshotId>>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn list_transaction_logs<'life0, 'life1, 'async_trait>( &'life0 self, settings: &'life1 Settings, ) -> Pin<Box<dyn Future<Output = StorageResult<BoxStream<'_, StorageResult<ListInfo<SnapshotId>>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn delete_chunks<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, chunks: BoxStream<'life2, (ChunkId, u64)>, ) -> Pin<Box<dyn Future<Output = StorageResult<DeleteObjectsResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn delete_manifests<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, manifests: BoxStream<'life2, (ManifestId, u64)>, ) -> Pin<Box<dyn Future<Output = StorageResult<DeleteObjectsResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn delete_snapshots<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, snapshots: BoxStream<'life2, (SnapshotId, u64)>, ) -> Pin<Box<dyn Future<Output = StorageResult<DeleteObjectsResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn delete_transaction_logs<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, transaction_logs: BoxStream<'life2, (SnapshotId, u64)>, ) -> Pin<Box<dyn Future<Output = StorageResult<DeleteObjectsResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn delete_refs<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, refs: BoxStream<'life2, String>, ) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn get_object_concurrently_multiple<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, settings: &'life1 Settings, key: &'life2 str, parts: Vec<Range<u64>>, ) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn Buf + Send + Unpin>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn get_object_concurrently<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, settings: &'life1 Settings, key: &'life2 str, range: &'life3 Range<u64>, ) -> Pin<Box<dyn Future<Output = StorageResult<Reader>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: '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> 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T