Struct dementia::Homeserver[][src]

pub struct Homeserver { /* fields omitted */ }

Represents a Matrix homeserver to which an access token has been created

Methods

impl Homeserver
[src]

Start creating a new Homeserver object

This does not create a stateful connection. It only constructs a request object and saves the URL of the Homeserver.

  • server_name – The homeserver URL without trailing slash, e. g. https://matrix.org
  • access_token – The access token

Create a new Homeserver object

This does not create a stateful connection. It only constructs a request object and saves the URL of the Homeserver.

  • server_name – The homeserver URL without trailing slash, e. g. https://matrix.org
  • access_token – The access token

Create a new Homeserver object from username an password combination

This does not create a stateful connection. It only constructs a request object and saves the URL of the Homeserver.

  • server_name – The homeserver URL without trailing slash, e. g. https://matrix.org
  • username – The username without homeserver part, e. g. bot
  • password – The password

Panics

If the server does not support or allow simple username and password login, this function panics.

Returns the access token

This is especially usefull, if you authenticated via username and password and want to retrieve the access token for later use.

Creates a Matrix room object

This joins the room. If the room has already been joined, this function can be called anyway to only create the room object.

If the room cannot be joined, None is returned

Creates a new Matrix room on the server and returns a Matrix room object

The room will be created with the preset public_chat. Thus, everyone can join the room.

If the room cannot be created or already exists, None is returned.

Get all current invites from the server

Returns a list of all room, the bot has been invited to.

Auto Trait Implementations

impl !Send for Homeserver

impl !Sync for Homeserver