[][src]Struct glitch_in_the_matrix::MatrixClient

pub struct MatrixClient { /* fields omitted */ }

A connection to a Matrix homeserver, using the hyper crate.

Methods

impl MatrixClient[src]

pub fn new_from_access_token(
    token: &str,
    url: &str,
    hdl: &Handle
) -> impl Future<Item = Self, Error = MatrixError>
[src]

pub fn login_password(
    username: &str,
    password: &str,
    url: &str,
    hdl: &Handle
) -> impl Future<Item = Self, Error = MatrixError>
[src]

Log in to a Matrix homeserver with a username and password, and return a client object.

Parameters

  • username: the username of the account to use (NB: not a MXID)
  • password: the password of the account to use
  • url: the URL of the homeserver
  • hdl: Tokio reactor handle

pub fn as_register_user(
    &mut self,
    user_id: String
) -> impl Future<Item = (), Error = MatrixError>
[src]

(for Application Services) Register a user with the given user_id.

pub fn as_new(
    url: String,
    user_id: String,
    as_token: String,
    hdl: &Handle
) -> MatrixResult<Self>
[src]

(for Application Services) Make a new AS client.

Parameters

  • url: homeserver URL
  • user_id: user ID to impersonate (can be changed later, using alter_user_id)
  • as_token: application service token
  • hdl: Tokio reactor handle

pub fn as_alter_user_id(&mut self, user_id: String)[src]

(for Application Services) Alter the user ID which this client is masquerading as.

pub fn get_hyper(&self) -> MatrixHyper[src]

Convenience method that clones the MatrixClient's underlying HTTP client. Useful if you don't want to have to make your own HTTP client, and need one for some quick'n'dirty task.

Trait Implementations

impl Clone for MatrixClient[src]

impl Drop for MatrixClient[src]

fn drop(&mut self)[src]

Invalidates our access token, so we don't have millions of devices. Also sets us as offline.

impl MatrixRequestable for MatrixClient[src]

type Txnid = Uuid

The type of the transaction ID returned by get_txnid().

type ResponseBody = Chunk

The type of the HTTP response body.

type ResponseBodyFuture = MxClientResponseBodyFuture

The type of the future returned as a HTTP response body. Read more

type SendRequestFuture = MxClientSendRequestFuture

The type of the future returned by send_request(). Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.