pub struct File(/* private fields */);Available on crate feature
file-backend only.Expand description
A file-backed backend.
Note: this requires its futures to be executed on the Tokio 0.3 runtime.
Implementations§
Source§impl File
impl File
Sourcepub async fn from_path<P>(path: P) -> Result<Self, Error>
pub async fn from_path<P>(path: P) -> Result<Self, Error>
Creates the backend by opening the file at the given path.
§Errors
If the file does not exist or could not be opened for reading and writing, an error variant is returned.
Sourcepub async fn from_path_or_create<P>(path: P) -> Result<(Self, bool), Error>
pub async fn from_path_or_create<P>(path: P) -> Result<(Self, bool), Error>
Creates the backend by opening a file at the given path. Creates the file if it does not exist yet.
§Errors
If the file does not exist, but could not be created, or could not be opened for reading and writing, an error variant is returned.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for File
impl !RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl !UnwindSafe for File
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