Skip to main content

FilesystemRemoteStore

Struct FilesystemRemoteStore 

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

Local-filesystem implementation of RemoteStore.

All operations are idempotent and atomic where applicable. upload uses a .tmp write + rename to prevent torn writes (T-04-10).

Implementations§

Source§

impl FilesystemRemoteStore

Source

pub fn new(base_dir: PathBuf) -> Result<Self, EdgestoreError>

Create a new FilesystemRemoteStore rooted at base_dir.

Creates base_dir (and all parent directories) if it does not exist.

Trait Implementations§

Source§

impl RemoteStore for FilesystemRemoteStore

Source§

fn upload(&self, hash: &[u8; 32], data: &[u8]) -> Result<(), EdgestoreError>

Store data under hash. Idempotent: if the file already exists, returns Ok(()).

Writes to a .tmp file first, then renames atomically (T-04-10).

Source§

fn download(&self, hash: &[u8; 32]) -> Result<Vec<u8>, EdgestoreError>

Download the segment bytes for hash.

Returns EdgestoreError::ReplicationError if the segment is not present.

Source§

fn list(&self) -> Result<Vec<[u8; 32]>, EdgestoreError>

List all stored segment hashes by scanning {base_dir}/*.seg.

Filenames that are not exactly 64 lowercase hex characters followed by .seg are silently skipped (T-04-12).

Source§

fn delete(&self, hash: &[u8; 32]) -> Result<(), EdgestoreError>

Remove the segment for hash. No-op if the segment does not exist (idempotent).

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V