pub struct PersistentRoot { /* private fields */ }Expand description
A persistent working directory where Ditto will store its data across restarts of the host process on the local file system
Implementations§
Source§impl PersistentRoot
impl PersistentRoot
Sourcepub fn new(root_dir: impl Into<PathBuf>) -> Result<Self, DittoError>
pub fn new(root_dir: impl Into<PathBuf>) -> Result<Self, DittoError>
Manually construct a root directory
Sourcepub fn from_current_exe() -> Result<Self, DittoError>
pub fn from_current_exe() -> Result<Self, DittoError>
Get a Ditto directory from the path of the current executable
Sourcepub fn from_env() -> Result<Self, DittoError>
pub fn from_env() -> Result<Self, DittoError>
Create a Ditto directory from env vars
Trait Implementations§
Source§impl Default for PersistentRoot
impl Default for PersistentRoot
Source§impl DittoRoot for PersistentRoot
impl DittoRoot for PersistentRoot
Source§fn is_valid(&self) -> Result<(), DittoError>
fn is_valid(&self) -> Result<(), DittoError>
Return true if the provided Root path is a valid path
Source§fn data_path(&self) -> &Path
fn data_path(&self) -> &Path
👎Deprecated: Use root_path instead
Return the path of the data in the Ditto directory
Source§fn root_dir_to_c_str(&self) -> Result<Box, DittoError>
fn root_dir_to_c_str(&self) -> Result<Box, DittoError>
Emits the Ditto root directory path as a null-terminated UTF-8 C-string
Source§fn data_dir_to_c_str(&self) -> Result<Box, DittoError>
fn data_dir_to_c_str(&self) -> Result<Box, DittoError>
👎Deprecated: Use root_dir_to_c_str instead
Emits the Ditto data directory path as a null-terminated UTF-8 C-string
Source§fn root_path_as_str(&self) -> Result<&str, DittoError>
fn root_path_as_str(&self) -> Result<&str, DittoError>
Return the Root path as a
&strSource§fn data_path_as_str(&self) -> Result<&str, DittoError>
fn data_path_as_str(&self) -> Result<&str, DittoError>
👎Deprecated: Use root_path_as_str instead
Returns the path of the Ditto data directory as an
&strAuto Trait Implementations§
impl Freeze for PersistentRoot
impl RefUnwindSafe for PersistentRoot
impl Send for PersistentRoot
impl Sync for PersistentRoot
impl Unpin for PersistentRoot
impl UnwindSafe for PersistentRoot
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