pub struct StdStorage { /* private fields */ }Expand description
A WalStorage backend that maps file names to a directory on the
local filesystem.
Implementations§
Trait Implementations§
Source§impl WalStorage for StdStorage
impl WalStorage for StdStorage
Source§fn read_file(&self, name: &str) -> Result<Vec<u8>, Self::Error>
fn read_file(&self, name: &str) -> Result<Vec<u8>, Self::Error>
Reads the entire contents of the named file. Read more
Source§fn write_file(&mut self, name: &str, data: &[u8]) -> Result<(), Self::Error>
fn write_file(&mut self, name: &str, data: &[u8]) -> Result<(), Self::Error>
Creates or overwrites a file with the given contents. Read more
Source§fn append_file(&mut self, name: &str, data: &[u8]) -> Result<(), Self::Error>
fn append_file(&mut self, name: &str, data: &[u8]) -> Result<(), Self::Error>
Appends data to an existing file (or creates it). Read more
Source§fn remove_file(&mut self, name: &str) -> Result<(), Self::Error>
fn remove_file(&mut self, name: &str) -> Result<(), Self::Error>
Removes a file. Implementations should not error if the file
does not exist. Read more
Source§fn list_files(&self, suffix: &str) -> Result<Vec<String>, Self::Error>
fn list_files(&self, suffix: &str) -> Result<Vec<String>, Self::Error>
Lists all file names that end with
suffix, sorted. Read moreSource§fn sync_file(&mut self, name: &str) -> Result<(), Self::Error>
fn sync_file(&mut self, name: &str) -> Result<(), Self::Error>
Ensures buffered data for the named file is durably persisted. Read more
Source§fn file_size(&self, name: &str) -> Result<u64, Self::Error>
fn file_size(&self, name: &str) -> Result<u64, Self::Error>
Returns the size of the named file in bytes. Read more
Source§fn file_exists(&self, name: &str) -> bool
fn file_exists(&self, name: &str) -> bool
Returns true if the named file exists.
Auto Trait Implementations§
impl Freeze for StdStorage
impl RefUnwindSafe for StdStorage
impl Send for StdStorage
impl Sync for StdStorage
impl Unpin for StdStorage
impl UnsafeUnpin for StdStorage
impl UnwindSafe for StdStorage
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