[−][src]Struct glitch_in_the_matrix::MatrixClient
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]
token: &str,
url: &str,
hdl: &Handle
) -> impl Future<Item = Self, Error = MatrixError>
pub fn login_password(
username: &str,
password: &str,
url: &str,
hdl: &Handle
) -> impl Future<Item = Self, Error = MatrixError>
[src]
username: &str,
password: &str,
url: &str,
hdl: &Handle
) -> impl Future<Item = Self, Error = MatrixError>
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 useurl
: the URL of the homeserverhdl
: Tokio reactor handle
pub fn as_register_user(
&mut self,
user_id: String
) -> impl Future<Item = (), Error = MatrixError>
[src]
&mut self,
user_id: String
) -> impl Future<Item = (), Error = MatrixError>
(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]
url: String,
user_id: String,
as_token: String,
hdl: &Handle
) -> MatrixResult<Self>
(for Application Services) Make a new AS client.
Parameters
url
: homeserver URLuser_id
: user ID to impersonate (can be changed later, usingalter_user_id
)as_token
: application service tokenhdl
: 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]
fn clone(&self) -> MatrixClient
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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
fn get_url(&self) -> Cow<str>
[src]
fn get_access_token(&self) -> Cow<str>
[src]
fn get_txnid(&mut self) -> Uuid
[src]
fn get_user_id(&self) -> Cow<str>
[src]
fn is_as(&self) -> bool
[src]
fn send_request(&mut self, req: Request<Vec<u8>>) -> Self::SendRequestFuture
[src]
fn typed_api_call<T>(
&mut self,
req: Request<Vec<u8>>,
discard: bool
) -> TypedApiResponse<T, Self::SendRequestFuture, Self::ResponseBodyFuture> where
T: DeserializeOwned + 'static,
[src]
&mut self,
req: Request<Vec<u8>>,
discard: bool
) -> TypedApiResponse<T, Self::SendRequestFuture, Self::ResponseBodyFuture> where
T: DeserializeOwned + 'static,
Auto Trait Implementations
impl !RefUnwindSafe for MatrixClient
impl !Send for MatrixClient
impl !Sync for MatrixClient
impl Unpin for MatrixClient
impl !UnwindSafe for MatrixClient
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,