Struct ruma_client::Client [−][src]
pub struct Client<C>(_);
Expand description
A client for the Matrix client-server API.
Implementations
impl<C> Client<C>
[src]
impl<C> Client<C>
[src]pub fn with_http_client(
http_client: C,
homeserver_url: String,
access_token: Option<String>
) -> Self
[src]
pub fn with_http_client(
http_client: C,
homeserver_url: String,
access_token: Option<String>
) -> Self
[src]Creates a new client using the given underlying HTTP client.
This allows the user to configure the details of HTTP as desired.
pub fn access_token(&self) -> Option<String>
[src]
pub fn access_token(&self) -> Option<String>
[src]Get a copy of the current access_token
, if any.
Useful for serializing and persisting the session to be restored later.
impl<C: DefaultConstructibleHttpClient> Client<C>
[src]
impl<C: DefaultConstructibleHttpClient> Client<C>
[src]impl<C: HttpClient> Client<C>
[src]
impl<C: HttpClient> Client<C>
[src]pub async fn send_request<R: OutgoingRequest>(
&self,
request: R
) -> ResponseResult<C, R>
[src]
pub async fn send_request<R: OutgoingRequest>(
&self,
request: R
) -> ResponseResult<C, R>
[src]Makes a request to a Matrix API endpoint.
pub async fn send_customized_request<R, F>(
&self,
request: R,
customize: F
) -> ResponseResult<C, R> where
R: OutgoingRequest,
F: FnOnce(&mut Request<C::RequestBody>) -> Result<(), ResponseError<C, R>>,
[src]
pub async fn send_customized_request<R, F>(
&self,
request: R,
customize: F
) -> ResponseResult<C, R> where
R: OutgoingRequest,
F: FnOnce(&mut Request<C::RequestBody>) -> Result<(), ResponseError<C, R>>,
[src]Makes a request to a Matrix API endpoint including additional URL parameters.
pub async fn send_request_as<R: OutgoingRequest>(
&self,
user_id: &UserId,
request: R
) -> ResponseResult<C, R>
[src]
pub async fn send_request_as<R: OutgoingRequest>(
&self,
user_id: &UserId,
request: R
) -> ResponseResult<C, R>
[src]Makes a request to a Matrix API endpoint as a virtual user.
This method is meant to be used by application services when interacting with the client-server API.
Trait Implementations
Auto Trait Implementations
impl<C> RefUnwindSafe for Client<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
impl<C> Send for Client<C> where
C: Send + Sync,
C: Send + Sync,
impl<C> Sync for Client<C> where
C: Send + Sync,
C: Send + Sync,
impl<C> Unpin for Client<C>
impl<C> UnwindSafe for Client<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more