Struct mxlink::InitConfig
source · pub struct InitConfig {
pub login: LoginConfig,
pub persistence: PersistenceConfig,
}Fields§
§login: LoginConfig§persistence: PersistenceConfigImplementations§
source§impl InitConfig
impl InitConfig
sourcepub fn new(login: LoginConfig, persistence: PersistenceConfig) -> Self
pub fn new(login: LoginConfig, persistence: PersistenceConfig) -> Self
Examples found in repository?
examples/quick_start.rs (line 61)
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")
}Auto Trait Implementations§
impl Freeze for InitConfig
impl RefUnwindSafe for InitConfig
impl Send for InitConfig
impl Sync for InitConfig
impl Unpin for InitConfig
impl UnwindSafe for InitConfig
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, 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