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
impl FilesystemRemoteStore
Sourcepub fn new(base_dir: PathBuf) -> Result<Self, EdgestoreError>
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
impl RemoteStore for FilesystemRemoteStore
Source§fn upload(&self, hash: &[u8; 32], data: &[u8]) -> Result<(), EdgestoreError>
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>
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.
Auto Trait Implementations§
impl Freeze for FilesystemRemoteStore
impl RefUnwindSafe for FilesystemRemoteStore
impl Send for FilesystemRemoteStore
impl Sync for FilesystemRemoteStore
impl Unpin for FilesystemRemoteStore
impl UnsafeUnpin for FilesystemRemoteStore
impl UnwindSafe for FilesystemRemoteStore
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