pub struct FsFileStore;Expand description
Default filesystem-backed file store: every method calls straight
through to std::fs with the safety extras described in the module
docs.
Implementations§
Source§impl FsFileStore
impl FsFileStore
Trait Implementations§
Source§impl Debug for FsFileStore
impl Debug for FsFileStore
Source§impl Default for FsFileStore
impl Default for FsFileStore
Source§fn default() -> FsFileStore
fn default() -> FsFileStore
Returns the “default value” for a type. Read more
Source§impl FileStore for FsFileStore
impl FileStore for FsFileStore
Source§fn read(&self, path: &Path) -> Result<String, GettextError>
fn read(&self, path: &Path) -> Result<String, GettextError>
Read the file at
path as a UTF-8 string. Implementations should
strip any leading UTF-8 BOM before returning.Source§fn write(&self, path: &Path, content: &str) -> Result<(), GettextError>
fn write(&self, path: &Path, content: &str) -> Result<(), GettextError>
Atomically write
content to path. Implementations should hold
an advisory lock on the target during the write where possible.Source§fn write_bytes(&self, path: &Path, bytes: &[u8]) -> Result<(), GettextError>
fn write_bytes(&self, path: &Path, bytes: &[u8]) -> Result<(), GettextError>
Atomically write a raw byte buffer to
path. Used for binary
artifacts like .mo files. Default impl just routes through
FileStore::write by treating the bytes as UTF-8 — implementors
that need to honour arbitrary bytes (the production
FsFileStore) should override.Source§fn modified_time(&self, path: &Path) -> Result<SystemTime, GettextError>
fn modified_time(&self, path: &Path) -> Result<SystemTime, GettextError>
Return the on-disk modified time of
path, used by the store
manager to detect external edits and invalidate caches.Auto Trait Implementations§
impl Freeze for FsFileStore
impl RefUnwindSafe for FsFileStore
impl Send for FsFileStore
impl Sync for FsFileStore
impl Unpin for FsFileStore
impl UnsafeUnpin for FsFileStore
impl UnwindSafe for FsFileStore
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