Struct glitch_in_the_matrix::MatrixClient
[−]
[src]
pub struct MatrixClient { /* fields omitted */ }
A connection to a Matrix homeserver.
Methods
impl MatrixClient
[src]
fn login(
username: &str,
password: &str,
url: &str,
hdl: &Handle
) -> MatrixFuture<Self>
[src]
username: &str,
password: &str,
url: &str,
hdl: &Handle
) -> MatrixFuture<Self>
Log in to a Matrix homeserver, and return a client object.
fn join(&mut self, roomid: &str) -> MatrixFuture<JoinReply>
[src]
Join a room by identifier or alias.
fn update_presence(&mut self, p: Presence) -> MatrixFuture<()>
[src]
Update our presence status.
fn upload<T: Into<Body>>(
&mut self,
data: T,
ct: ContentType
) -> MatrixFuture<UploadReply>
[src]
&mut self,
data: T,
ct: ContentType
) -> MatrixFuture<UploadReply>
Upload some data (convertible to a Body
) of a given ContentType
, like an image.
Body
is accessible via the http
module. See the documentation there
for a complete reference of what implements Into<Body>
- a quick
shortlist: Vec<u8>
, &'static [u8]
(not &'a [u8]
, sadly), String
,
&'static str
.
ContentType
is accessible via the http
module. See the documentation
there for more information on how to use it.
fn user_id(&self) -> &str
[src]
Get the client's MXID.
fn get_sync_stream(&self) -> SyncStream
[src]
Get a SyncStream
, a Stream
used to obtain replies to the /sync
API.
This SyncStream
is independent from the original MatrixClient
, and
does not borrow from it in any way.
fn send_request<T>(&mut self, req: Request) -> MatrixFuture<T> where
T: DeserializeOwned + 'static,
[src]
T: DeserializeOwned + 'static,
Sends an arbitrary Request
to the Matrix homeserver, like one
generated by get_request_for()
.
fn send_discarding_request(&mut self, req: Request) -> MatrixFuture<()>
[src]
Like send_request()
, but discards the return value that the Matrix
homeserver sends back.
fn get_hyper(&mut self) -> &mut MatrixHyper
[src]
Get this MatrixClient
's underlying hyper::Client
.