pub struct FileSystemDataCache {
pub root_path: PathBuf,
}Expand description
Content-addressed storage backed by a local or network filesystem.
Fields§
§root_path: PathBufImplementations§
Trait Implementations§
Source§impl AsyncDataCache for FileSystemDataCache
impl AsyncDataCache for FileSystemDataCache
fn object_key(&self, hash: &str, algorithm: &str) -> String
fn as_any(&self) -> &dyn Any
fn object_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn copy_object_to_file<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
dest: &'life3 Path,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn copy_object_to_file<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
dest: &'life3 Path,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Copy a cached object directly to a file. The default reads into memory then writes.
Filesystem implementations can override for zero-copy (e.g. sendfile).
Source§fn write_object_to_file_at_offset<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
dest: &'life3 Path,
offset: u64,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn write_object_to_file_at_offset<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
dest: &'life3 Path,
offset: u64,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Write a cached object into an already-open file at a given offset.
Default reads into memory then writes. Filesystem can override for efficiency.
Source§fn copy_from<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_source: &'life1 dyn AsyncDataCache,
_hash: &'life2 str,
_algorithm: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<CopyResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn copy_from<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_source: &'life1 dyn AsyncDataCache,
_hash: &'life2 str,
_algorithm: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<CopyResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Attempt a server-side copy from another cache. Returns
NotSupported by default.Source§fn multipart_part_size(&self) -> usize
fn multipart_part_size(&self) -> usize
Returns the part size for multipart transfers. Default: 32MB. Read more
Source§fn as_multipart(&self) -> Option<&dyn MultipartDataCache>
fn as_multipart(&self) -> Option<&dyn MultipartDataCache>
Returns
Some(self) as a MultipartDataCache if the backend supports
S3-style multipart upload. Default: None.Source§fn as_range_read(&self) -> Option<&dyn RangeReadDataCache>
fn as_range_read(&self) -> Option<&dyn RangeReadDataCache>
Auto Trait Implementations§
impl Freeze for FileSystemDataCache
impl RefUnwindSafe for FileSystemDataCache
impl Send for FileSystemDataCache
impl Sync for FileSystemDataCache
impl Unpin for FileSystemDataCache
impl UnsafeUnpin for FileSystemDataCache
impl UnwindSafe for FileSystemDataCache
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.