pub struct ObjectStorage { /* private fields */ }Implementations§
Source§impl ObjectStorage
 
impl ObjectStorage
Sourcepub async fn new_in_memory() -> Result<ObjectStorage, StorageError>
 
pub async fn new_in_memory() -> Result<ObjectStorage, StorageError>
Create an in memory Storage implementation
This implementation should not be used in production code.
Sourcepub async fn new_local_filesystem(
    prefix: &StdPath,
) -> Result<ObjectStorage, StorageError>
 
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.
pub async fn new_s3( bucket: String, prefix: Option<String>, credentials: Option<S3Credentials>, config: Option<S3Options>, ) -> Result<ObjectStorage, StorageError>
pub async fn new_azure( account: String, container: String, prefix: Option<String>, credentials: Option<AzureCredentials>, config: Option<HashMap<AzureConfigKey, String>>, ) -> Result<ObjectStorage, StorageError>
pub async fn new_gcs( bucket: String, prefix: Option<String>, credentials: Option<GcsCredentials>, config: Option<HashMap<GoogleConfigKey, String>>, ) -> Result<ObjectStorage, StorageError>
Sourcepub fn artificially_sort_refs_in_mem(&self) -> bool
 
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.
Sourcepub async fn all_keys(&self) -> StorageResult<Vec<String>>
 
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
 
impl Debug for ObjectStorage
Source§impl<'de> Deserialize<'de> for ObjectStorage
 
impl<'de> Deserialize<'de> for ObjectStorage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
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
 
impl Display for ObjectStorage
Source§impl Serialize for ObjectStorage
 
impl Serialize for ObjectStorage
Source§impl Storage for ObjectStorage
 
impl Storage for ObjectStorage
fn can_write(&self) -> bool
fn default_settings(&self) -> Settings
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,
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,
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,
 
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
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
 
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
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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§
impl !Freeze for ObjectStorage
impl !RefUnwindSafe for ObjectStorage
impl Send for ObjectStorage
impl Sync for ObjectStorage
impl Unpin for ObjectStorage
impl !UnwindSafe for ObjectStorage
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.