pub struct PersistentDataDir { /* private fields */ }Expand description
The data directory for the homeserver.
This is the directory that will store the homeservers data.
Implementations§
Source§impl PersistentDataDir
impl PersistentDataDir
Sourcepub fn new(path: PathBuf) -> Self
pub fn new(path: PathBuf) -> Self
Creates a new data directory.
path will be expanded to the home directory if it starts with “~”.
Sourcepub fn get_config_file_path(&self) -> PathBuf
pub fn get_config_file_path(&self) -> PathBuf
Returns the config file path in this directory.
Sourcepub fn get_secret_file_path(&self) -> PathBuf
pub fn get_secret_file_path(&self) -> PathBuf
Returns the path to the secret file.
Trait Implementations§
Source§impl Clone for PersistentDataDir
impl Clone for PersistentDataDir
Source§fn clone(&self) -> PersistentDataDir
fn clone(&self) -> PersistentDataDir
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DataDir for PersistentDataDir
impl DataDir for PersistentDataDir
Source§fn ensure_data_dir_exists_and_is_writable(&self) -> Result<()>
fn ensure_data_dir_exists_and_is_writable(&self) -> Result<()>
Makes sure the data directory exists. Create the directory if it doesn’t exist.
Source§fn read_or_create_config_file(&self) -> Result<ConfigToml>
fn read_or_create_config_file(&self) -> Result<ConfigToml>
Reads the config file from the data directory. Creates a default config file if it doesn’t exist.
Source§fn read_or_create_keypair(&self) -> Result<Keypair>
fn read_or_create_keypair(&self) -> Result<Keypair>
Reads the secret file. Creates a new secret file if it doesn’t exist.
Source§impl Debug for PersistentDataDir
impl Debug for PersistentDataDir
Auto Trait Implementations§
impl Freeze for PersistentDataDir
impl RefUnwindSafe for PersistentDataDir
impl Send for PersistentDataDir
impl Sync for PersistentDataDir
impl Unpin for PersistentDataDir
impl UnsafeUnpin for PersistentDataDir
impl UnwindSafe for PersistentDataDir
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more