pub struct FileStorageBackend { /* private fields */ }
Expand description
Multi-writer support for different platforms:
- Modern Linux kernels are well supported. However because Linux implementation leverages
RENAME_NOREPLACE
, older versions of the kernel might not work depending on what filesystem is being used:- ext4 requires >= Linux 3.15
- btrfs, shmem, and cif requires >= Linux 3.17
- xfs requires >= Linux 4.0
- ext2, minix, reiserfs, jfs, vfat, and bpf requires >= Linux 4.9
- Darwin is supported but not fully tested. Patches welcome.
- Support for other platforms are not implemented at the moment.
Implementations§
Source§impl FileStorageBackend
impl FileStorageBackend
Sourcepub fn try_new(path: impl AsRef<Path>) -> ObjectStoreResult<Self>
pub fn try_new(path: impl AsRef<Path>) -> ObjectStoreResult<Self>
Creates a new FileStorageBackend.
Trait Implementations§
Source§impl Debug for FileStorageBackend
impl Debug for FileStorageBackend
Source§impl Display for FileStorageBackend
impl Display for FileStorageBackend
Source§impl ObjectStore for FileStorageBackend
impl ObjectStore for FileStorageBackend
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
bytes: PutPayload,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<PutResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
bytes: PutPayload,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<PutResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save the provided bytes to the specified location Read more
Source§fn put_opts<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
bytes: PutPayload,
options: PutOptions,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<PutResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_opts<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
bytes: PutPayload,
options: PutOptions,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<PutResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save the provided
payload
to location
with the given optionsSource§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<GetResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<GetResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the bytes that are stored at the specified location.
Source§fn get_opts<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
options: GetOptions,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<GetResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_opts<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
options: GetOptions,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<GetResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform a get request with options
Source§fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
range: Range<usize>,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
range: Range<usize>,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the bytes that are stored at the specified location
in the given byte range. Read more
Source§fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<ObjectMeta>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<ObjectMeta>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the metadata for the specified location
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete the object at the specified location.
Source§fn list(
&self,
prefix: Option<&ObjectStorePath>,
) -> BoxStream<'_, ObjectStoreResult<ObjectMeta>>
fn list( &self, prefix: Option<&ObjectStorePath>, ) -> BoxStream<'_, ObjectStoreResult<ObjectMeta>>
List all the objects with the given prefix. Read more
Source§fn list_with_offset(
&self,
prefix: Option<&ObjectStorePath>,
offset: &ObjectStorePath,
) -> BoxStream<'_, ObjectStoreResult<ObjectMeta>>
fn list_with_offset( &self, prefix: Option<&ObjectStorePath>, offset: &ObjectStorePath, ) -> BoxStream<'_, ObjectStoreResult<ObjectMeta>>
List all the objects with the given prefix and a location greater than
offset
Read moreSource§fn list_with_delimiter<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 ObjectStorePath>,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<ListResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_with_delimiter<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 ObjectStorePath>,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<ListResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List objects with the given prefix and an implementation specific
delimiter. Returns common prefixes (directories) in addition to object
metadata. Read more
Source§fn copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ObjectStorePath,
to: &'life2 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ObjectStorePath,
to: &'life2 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Copy an object from one path to another in the same object store. Read more
Source§fn copy_if_not_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ObjectStorePath,
to: &'life2 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn copy_if_not_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ObjectStorePath,
to: &'life2 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Copy an object from one path to another, only if destination is empty. Read more
Source§fn rename_if_not_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ObjectStorePath,
to: &'life2 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename_if_not_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ObjectStorePath,
to: &'life2 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Move an object from one path to another in the same object store. Read more
Source§fn put_multipart<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<Box<dyn MultipartUpload>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_multipart<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<Box<dyn MultipartUpload>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform a multipart upload Read more
Source§fn put_multipart_opts<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
options: PutMultipartOpts,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<Box<dyn MultipartUpload>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_multipart_opts<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 ObjectStorePath,
options: PutMultipartOpts,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<Box<dyn MultipartUpload>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform a multipart upload with options Read more
Source§fn get_ranges<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
location: &'life1 Path,
ranges: &'life2 [Range<usize>],
) -> Pin<Box<dyn Future<Output = Result<Vec<Bytes>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn get_ranges<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
location: &'life1 Path,
ranges: &'life2 [Range<usize>],
) -> Pin<Box<dyn Future<Output = Result<Vec<Bytes>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Return the bytes that are stored at the specified location
in the given byte ranges
Source§fn delete_stream<'a>(
&'a self,
locations: Pin<Box<dyn Stream<Item = Result<Path, Error>> + Send + 'a>>,
) -> Pin<Box<dyn Stream<Item = Result<Path, Error>> + Send + 'a>>
fn delete_stream<'a>( &'a self, locations: Pin<Box<dyn Stream<Item = Result<Path, Error>> + Send + 'a>>, ) -> Pin<Box<dyn Stream<Item = Result<Path, Error>> + Send + 'a>>
Delete all the objects at the specified locations Read more
Source§fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Move an object from one path to another in the same object store. Read more
Auto Trait Implementations§
impl Freeze for FileStorageBackend
impl RefUnwindSafe for FileStorageBackend
impl Send for FileStorageBackend
impl Sync for FileStorageBackend
impl Unpin for FileStorageBackend
impl UnwindSafe for FileStorageBackend
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 moreSource§impl<T> ObjectStoreRetryExt for Twhere
T: ObjectStore + ?Sized,
impl<T> ObjectStoreRetryExt for Twhere
T: ObjectStore + ?Sized,
Source§fn put_with_retries<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 Path,
bytes: PutPayload,
max_retries: usize,
) -> Pin<Box<dyn Future<Output = Result<PutResult>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_with_retries<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 Path,
bytes: PutPayload,
max_retries: usize,
) -> Pin<Box<dyn Future<Output = Result<PutResult>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save the provided bytes to the specified location Read more
Source§fn delete_with_retries<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 Path,
max_retries: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_with_retries<'life0, 'life1, 'async_trait>(
&'life0 self,
location: &'life1 Path,
max_retries: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete the object at the specified location