Export type aliases HttpClient and HttpsClient
This commit is contained in:
parent
419a046098
commit
bbeb437635
11
src/lib.rs
11
src/lib.rs
@ -149,7 +149,10 @@ where
|
|||||||
session: Mutex<Option<Session>>,
|
session: Mutex<Option<Session>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Client<HttpConnector> {
|
/// Non-secured variant of the client (using plain HTTP requests)
|
||||||
|
pub type HttpClient = Client<HttpConnector>;
|
||||||
|
|
||||||
|
impl HttpClient {
|
||||||
/// Creates a new client for making HTTP requests to the given homeserver.
|
/// Creates a new client for making HTTP requests to the given homeserver.
|
||||||
pub fn new(homeserver_url: Url, session: Option<Session>) -> Self {
|
pub fn new(homeserver_url: Url, session: Option<Session>) -> Self {
|
||||||
Self(Arc::new(ClientData {
|
Self(Arc::new(ClientData {
|
||||||
@ -171,8 +174,12 @@ impl Client<HttpConnector> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Secured variant of the client (using HTTPS requests)
|
||||||
#[cfg(feature = "tls")]
|
#[cfg(feature = "tls")]
|
||||||
impl Client<HttpsConnector<HttpConnector>> {
|
pub type HttpsClient = Client<HttpsConnector<HttpConnector>>;
|
||||||
|
|
||||||
|
#[cfg(feature = "tls")]
|
||||||
|
impl HttpsClient {
|
||||||
/// Creates a new client for making HTTPS requests to the given homeserver.
|
/// Creates a new client for making HTTPS requests to the given homeserver.
|
||||||
pub fn https(homeserver_url: Url, session: Option<Session>) -> Result<Self, NativeTlsError> {
|
pub fn https(homeserver_url: Url, session: Option<Session>) -> Result<Self, NativeTlsError> {
|
||||||
let connector = HttpsConnector::new(4)?;
|
let connector = HttpsConnector::new(4)?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user