pub struct PathBackend { /* private fields */ }
Expand description

A Backend using a file given the path.

Features atomic saves, so that the database file won’t be corrupted or deleted if the program panics during the save.

Implementations

Opens a new PathBackend for a given path. Errors when the file doesn’t yet exist.

Opens a new PathBackend for a given path. Creates a file if it doesn’t yet exist.

Returns the PathBackend and whether the file already existed.

Opens a new PathBackend for a given path. Creates a file if it doesn’t yet exist, and calls closure with it.

Trait Implementations

Write the byte slice to the backend. This uses and atomic save.

This won’t corrupt the existing database file if the program panics during the save.

Read the all data from the backend.
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.