pub struct DocsStorage { /* private fields */ }Implementations§
Source§impl DocsStorage
impl DocsStorage
pub fn new(storage: DynStorage) -> Self
Sourcepub fn file_key(crate_name: &str, version: &str, relative_path: &str) -> String
pub fn file_key(crate_name: &str, version: &str, relative_path: &str) -> String
Key for one file under a crate+version’s doc tree, e.g.
file_key("my-crate", "1.0.0", "doc/my_crate/index.html").
pub fn version_prefix(crate_name: &str, version: &str) -> String
pub fn crate_prefix(crate_name: &str) -> String
pub async fn put(&self, key: &str, data: Bytes) -> Result<(), StorageError>
pub async fn get(&self, key: &str) -> Result<Bytes, StorageError>
pub async fn get_with_meta( &self, key: &str, ) -> Result<ObjectWithMeta, StorageError>
pub async fn exists(&self, key: &str) -> Result<bool, StorageError>
pub async fn delete(&self, key: &str) -> Result<(), StorageError>
pub async fn list(&self, prefix: &str) -> Result<Vec<String>, StorageError>
Sourcepub async fn delete_prefix(&self, prefix: &str) -> Result<(), StorageError>
pub async fn delete_prefix(&self, prefix: &str) -> Result<(), StorageError>
Delete every key under prefix (used for crate/version teardown).
Sourcepub async fn version_candidates(
&self,
crate_name: &str,
) -> Result<Vec<String>, StorageError>
pub async fn version_candidates( &self, crate_name: &str, ) -> Result<Vec<String>, StorageError>
Distinct version-folder names that have any key under crate_name/.
Callers still need to verify a given version actually has an
index.html — this only enumerates candidates.
Auto Trait Implementations§
impl !RefUnwindSafe for DocsStorage
impl !UnwindSafe for DocsStorage
impl Freeze for DocsStorage
impl Send for DocsStorage
impl Sync for DocsStorage
impl Unpin for DocsStorage
impl UnsafeUnpin for DocsStorage
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 more