pub struct MatrixConfig { /* private fields */ }Expand description
Implementations§
Source§impl MatrixConfig
impl MatrixConfig
Sourcepub fn new(homeserver_url: impl Into<String>) -> Self
pub fn new(homeserver_url: impl Into<String>) -> Self
Create a new Matrix configuration with the given homeserver URL
Authentication must be configured before building the bot.
Sourcepub fn password_auth(
self,
user_id: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn password_auth( self, user_id: impl Into<String>, password: impl Into<String>, ) -> Self
Set password authentication
§Arguments
user_id- Matrix user ID (e.g., “@bot:matrix.org”)password- Password for the account
Sourcepub fn access_token_auth(
self,
user_id: OwnedUserId,
access_token: impl Into<String>,
device_id: OwnedDeviceId,
) -> Self
pub fn access_token_auth( self, user_id: OwnedUserId, access_token: impl Into<String>, device_id: OwnedDeviceId, ) -> Self
Set access token authentication
Use this for pre-authenticated sessions. Requires the device ID for E2EE.
Sourcepub fn command_prefix(self, prefix: impl Into<String>) -> Self
pub fn command_prefix(self, prefix: impl Into<String>) -> Self
Set the command prefix (default: “!”)
Messages starting with this prefix will be parsed as commands.
Sourcepub fn device_name(self, name: impl Into<String>) -> Self
pub fn device_name(self, name: impl Into<String>) -> Self
Set the device display name
This appears in the user’s device list.
Sourcepub fn state_store_path(self, path: impl Into<PathBuf>) -> Self
pub fn state_store_path(self, path: impl Into<PathBuf>) -> Self
Set the state store path for persistence
Enables session persistence and E2EE key storage. Without this, E2EE keys are lost on restart.
Sourcepub fn auto_join_rooms(self, enabled: bool) -> Self
pub fn auto_join_rooms(self, enabled: bool) -> Self
Enable or disable auto-joining rooms when invited
Auto Trait Implementations§
impl Freeze for MatrixConfig
impl RefUnwindSafe for MatrixConfig
impl Send for MatrixConfig
impl Sync for MatrixConfig
impl Unpin for MatrixConfig
impl UnsafeUnpin for MatrixConfig
impl UnwindSafe for MatrixConfig
Blanket Implementations§
impl<T> Any for Twhere
T: Any,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ChatActionSenderBounds for T
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
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