Skip to main content

FsStore

Struct FsStore 

Source
pub struct FsStore { /* private fields */ }
Expand description

Filesystem-backed content-addressed blob and fenced root store.

Implementations§

Source§

impl FsStore

Source

pub fn open(root: impl AsRef<Path>) -> Result<Self, StoreError>

Opens or creates a store below root.

§Errors

Returns an error if the directory layout cannot be created.

Trait Implementations§

Source§

impl BlobStore for FsStore

Source§

fn put(&self, bytes: &[u8]) -> Result<BlobId, StoreError>

Stores bytes and returns their content id. Read more
Source§

fn get(&self, id: &BlobId) -> Result<Option<Vec<u8>>, StoreError>

Loads bytes by id, returning None when missing. Read more
Source§

fn contains(&self, id: &BlobId) -> Result<bool, StoreError>

Reports whether a blob is present. Read more
Source§

fn delete(&self, id: &BlobId) -> Result<(), StoreError>

Deletes a blob during garbage collection. Missing blobs are ignored. Read more
Source§

fn list(&self) -> Result<Vec<BlobId>, StoreError>

Lists all blob identifiers known to this backend. Read more
Source§

fn modified_at(&self, id: &BlobId) -> Result<Option<SystemTime>, StoreError>

Returns the blob’s creation/last-modification time when available. Backends without timestamps return None, which conservatively keeps the blob whenever a non-zero retention window is active. Read more
Source§

impl RootStore for FsStore

Source§

fn get_root(&self, name: &str) -> Result<Option<Vec<u8>>, StoreError>

Reads a root pointer. Read more
Source§

fn cas_root( &self, name: &str, expected: Option<&[u8]>, new: &[u8], ) -> Result<(), StoreError>

Publishes a root only if the stored pointer equals expected. Read more
Source§

fn delete_root(&self, name: &str) -> Result<(), StoreError>

Removes a root pointer. Missing roots are ignored. Read more
Source§

fn list_roots(&self, prefix: &str) -> Result<Vec<String>, StoreError>

Lists root names beginning with prefix, in sorted order. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.