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
 
impl HomeserverConnection
Sourcepub const VALID_BEARER_TOKEN: &str = "mock_homeserver_bearer_token"
 
pub const VALID_BEARER_TOKEN: &str = "mock_homeserver_bearer_token"
A valid bearer token that will be accepted by
crate::HomeserverConnection::verify_token.
pub async fn reserve_localpart(&self, localpart: &'static str)
Trait Implementations§
Source§impl HomeserverConnection for HomeserverConnection
 
impl HomeserverConnection for HomeserverConnection
Source§fn homeserver(&self) -> &str
 
fn homeserver(&self) -> &str
Get the homeserver URL.
Source§fn verify_token<'life0, 'life1, 'async_trait>(
    &'life0 self,
    token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn verify_token<'life0, 'life1, 'async_trait>(
    &'life0 self,
    token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Verify a bearer token coming from the homeserver for homeserver to MAS
interactions Read more
Source§fn query_user<'life0, 'life1, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MatrixUser, Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn query_user<'life0, 'life1, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MatrixUser, 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, Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn provision_user<'life0, 'life1, 'async_trait>(
    &'life0 self,
    request: &'life1 ProvisionRequest,
) -> Pin<Box<dyn Future<Output = Result<bool, 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, Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn is_localpart_available<'life0, 'life1, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, 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 upsert_device<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
    device_id: &'life2 str,
    _initial_display_name: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
 
fn upsert_device<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
    device_id: &'life2 str,
    _initial_display_name: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
Create a device for a user on the homeserver. Read more
Source§fn update_device_display_name<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
    device_id: &'life2 str,
    _display_name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
 
fn update_device_display_name<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
    device_id: &'life2 str,
    _display_name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
Update the display name of a device for a user on the homeserver. Read more
Source§fn delete_device<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
    device_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn delete_device<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
    device_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), 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,
    localpart: &'life1 str,
    devices: HashSet<String>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn sync_devices<'life0, 'life1, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
    devices: HashSet<String>,
) -> Pin<Box<dyn Future<Output = Result<(), 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,
    localpart: &'life1 str,
    erase: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn delete_user<'life0, 'life1, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
    erase: bool,
) -> Pin<Box<dyn Future<Output = Result<(), 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,
    localpart: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn reactivate_user<'life0, 'life1, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), 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,
    localpart: &'life1 str,
    displayname: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn set_displayname<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
    displayname: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), 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,
    localpart: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn unset_displayname<'life0, 'life1, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), 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,
    localpart: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn allow_cross_signing_reset<'life0, 'life1, 'async_trait>(
    &'life0 self,
    localpart: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), 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
Auto Trait Implementations§
impl !Freeze for HomeserverConnection
impl !RefUnwindSafe for HomeserverConnection
impl Send for HomeserverConnection
impl Sync for HomeserverConnection
impl Unpin for HomeserverConnection
impl !UnwindSafe for HomeserverConnection
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> 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