pub struct FilesystemArtifactStorage { /* private fields */ }Expand description
Filesystem-backed ArtifactStorage.
Lays each artifact out under <base_path>/<artifact_id>/<filename>.
The generated base_url follows the same pattern - configure
base_url to match wherever the ArtifactsServer is reachable so
clients can resolve the URL.
Implementations§
Trait Implementations§
Source§impl ArtifactStorage for FilesystemArtifactStorage
impl ArtifactStorage for FilesystemArtifactStorage
Source§fn store<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
filename: &'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 store<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
filename: &'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,
Persist
data under artifact_id/filename and return the URL
at which it can be retrieved.Source§fn retrieve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
filename: &'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,
fn retrieve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
filename: &'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,
Retrieve the raw bytes stored at
artifact_id/filename.Source§fn exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
filename: &'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 exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
filename: &'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,
Whether a blob is stored at
artifact_id/filename.Source§fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
filename: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
filename: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete the blob at
artifact_id/filename. Returns Ok(()) if
it didn’t exist - idempotent.Source§fn cleanup_expired<'life0, 'async_trait>(
&'life0 self,
max_age: Duration,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cleanup_expired<'life0, 'async_trait>(
&'life0 self,
max_age: Duration,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete every blob whose modified time is older than
max_age.
Returns the number of blobs removed.Source§fn cleanup_oldest<'life0, 'async_trait>(
&'life0 self,
max_count: usize,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cleanup_oldest<'life0, 'async_trait>(
&'life0 self,
max_count: usize,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Trim the store down so at most
max_count blobs remain, deleting
the oldest first. Returns the number removed.Source§impl Clone for FilesystemArtifactStorage
impl Clone for FilesystemArtifactStorage
Source§fn clone(&self) -> FilesystemArtifactStorage
fn clone(&self) -> FilesystemArtifactStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FilesystemArtifactStorage
impl RefUnwindSafe for FilesystemArtifactStorage
impl Send for FilesystemArtifactStorage
impl Sync for FilesystemArtifactStorage
impl Unpin for FilesystemArtifactStorage
impl UnsafeUnpin for FilesystemArtifactStorage
impl UnwindSafe for FilesystemArtifactStorage
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more