Struct mas_matrix::MockHomeserverConnection

source ·
pub struct MockHomeserverConnection { /* private fields */ }
Expand description

A mock implementation of a HomeserverConnection, which never fails and doesn’t do anything.

Implementations§

source§

impl HomeserverConnection

source

pub fn new<H>(homeserver: H) -> Self
where H: Into<String>,

Create a new mock connection.

source

pub async fn reserve_localpart(&self, localpart: &'static str)

Trait Implementations§

source§

impl HomeserverConnection for HomeserverConnection

§

type Error = Error

The error type returned by all methods.
source§

fn homeserver(&self) -> &str

Get the homeserver URL.
source§

fn query_user<'life0, 'life1, 'async_trait>( &'life0 self, mxid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<MatrixUser, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query the state of a user on the homeserver. Read more
source§

fn provision_user<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 ProvisionRequest, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provision a user on the homeserver. Read more
source§

fn is_localpart_available<'life0, 'life1, 'async_trait>( &'life0 self, localpart: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check whether a given username is available on the homeserver. Read more
source§

fn create_device<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, mxid: &'life1 str, device_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create a device for a user on the homeserver. Read more
source§

fn delete_device<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, mxid: &'life1 str, device_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete a device for a user on the homeserver. Read more
source§

fn sync_devices<'life0, 'life1, 'async_trait>( &'life0 self, mxid: &'life1 str, devices: HashSet<String>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sync the list of devices of a user with the homeserver. Read more
source§

fn delete_user<'life0, 'life1, 'async_trait>( &'life0 self, mxid: &'life1 str, erase: bool, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a user on the homeserver. Read more
source§

fn reactivate_user<'life0, 'life1, 'async_trait>( &'life0 self, mxid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reactivate a user on the homeserver. Read more
source§

fn set_displayname<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, mxid: &'life1 str, displayname: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Set the displayname of a user on the homeserver. Read more
source§

fn unset_displayname<'life0, 'life1, 'async_trait>( &'life0 self, mxid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unset the displayname of a user on the homeserver. Read more
source§

fn allow_cross_signing_reset<'life0, 'life1, 'async_trait>( &'life0 self, mxid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Temporarily allow a user to reset their cross-signing keys. Read more
source§

fn mxid(&self, localpart: &str) -> String

Get the Matrix ID of the user with the given localpart. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.