Struct mxlink::PersistenceConfig
source · pub struct PersistenceConfig { /* private fields */ }Implementations§
source§impl Config
impl Config
sourcepub fn new(
session_file_path: PathBuf,
session_encryption_key: Option<EncryptionKey>,
db_dir_path: PathBuf,
) -> Self
pub fn new( session_file_path: PathBuf, session_encryption_key: Option<EncryptionKey>, db_dir_path: PathBuf, ) -> Self
Examples found in repository?
examples/quick_start.rs (line 59)
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
async fn create_matrix_link() -> MatrixLink {
let login_creds =
LoginCredentials::UserPassword(LOGIN_USERNAME.to_owned(), LOGIN_PASSWORD.to_owned());
let login_encryption = LoginEncryption::new(
Some(LOGIN_ENCRYPTION_RECOVERY_PASSPHRASE.to_owned()),
LOGIN_ENCRYPTION_RESET_ALLOWED,
);
let login_config = LoginConfig::new(
HOMESERVER_URL.to_owned(),
login_creds,
Some(login_encryption),
DEVICE_DISPLAY_NAME.to_owned(),
);
let session_file_path = std::path::PathBuf::from(PERSISTENCE_SESSION_FILE_PATH);
let session_encryption_key = EncryptionKey::from_hex_str(PERSISTENCE_SESSION_ENCRYPTION_KEY)
.expect("Invalid encryption key hex string");
let db_dir_path = std::path::PathBuf::from(PERSISTENCE_DB_DIR_PATH);
let persistence_config =
PersistenceConfig::new(session_file_path, Some(session_encryption_key), db_dir_path);
let init_config = InitConfig::new(login_config, persistence_config);
mxlink::init(&init_config)
.await
.expect("Failed to initialize MatrixLink")
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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