pub trait DittoRoot: Send + Sync {
    // Required methods
    fn root_path(&self) -> &Path;
    fn exists(&self) -> bool;
    fn is_valid(&self) -> Result<(), DittoError>;

    // Provided methods
    fn data_path(&self) -> &Path { ... }
    fn root_dir_to_c_str(&self) -> Result<Box, DittoError> { ... }
    fn data_dir_to_c_str(&self) -> Result<Box, DittoError> { ... }
    fn root_path_as_str(&self) -> Result<&str, DittoError> { ... }
    fn data_path_as_str(&self) -> Result<&str, DittoError> { ... }
}
Expand description

Interface provided by the Filesystem directory into which Ditto will store its local data

Required Methods§

source

fn root_path(&self) -> &Path

Return the root path of the Ditto directory

source

fn exists(&self) -> bool

Return true if the Root path exists

source

fn is_valid(&self) -> Result<(), DittoError>

Return true if the provided Root path is a valid path

Provided Methods§

source

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>

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>

👎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>

Return the Root path as a &str

source

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 &str

Implementors§