Cargo.toml: Bump the dependency versions.
parent
63e0191f57
commit
98da341a46
16
Cargo.toml
16
Cargo.toml
|
@ -12,17 +12,17 @@ version = "0.1.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
js_int = "0.1.2"
|
js_int = "0.1.2"
|
||||||
futures = "0.3.1"
|
futures = "0.3.4"
|
||||||
reqwest = "0.10.1"
|
reqwest = "0.10.1"
|
||||||
http = "0.2.0"
|
http = "0.2.0"
|
||||||
async-std = "1.4.0"
|
async-std = "1.5.0"
|
||||||
ruma-api = "0.12.0"
|
ruma-api = "0.13.0"
|
||||||
ruma-client-api = "0.5.0"
|
ruma-client-api = "0.6.0"
|
||||||
ruma-events = "0.15.1"
|
ruma-events = "0.15.0"
|
||||||
log = "0.4.8"
|
log = "0.4.8"
|
||||||
|
|
||||||
ruma-identifiers = "0.14.1"
|
ruma-identifiers = "0.14.1"
|
||||||
serde_json = "1.0.44"
|
serde_json = "1.0.48"
|
||||||
serde_urlencoded = "0.6.1"
|
serde_urlencoded = "0.6.1"
|
||||||
url = "2.1.1"
|
url = "2.1.1"
|
||||||
|
|
||||||
|
@ -31,6 +31,6 @@ version = "1.0.104"
|
||||||
features = ["derive"]
|
features = ["derive"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio = { version = "0.2.9", features = ["full"] }
|
tokio = { version = "0.2.11", features = ["full"] }
|
||||||
url = "2.1.1"
|
url = "2.1.1"
|
||||||
mockito = "0.22.0"
|
mockito = "0.23.3"
|
||||||
|
|
|
@ -158,7 +158,7 @@ impl SyncSettings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
use api::r0::send::send_message_event;
|
use api::r0::message::create_message_event;
|
||||||
use api::r0::session::login;
|
use api::r0::session::login;
|
||||||
use api::r0::sync::sync_events;
|
use api::r0::sync::sync_events;
|
||||||
|
|
||||||
|
@ -305,12 +305,12 @@ impl AsyncClient {
|
||||||
device_id: Option<S>,
|
device_id: Option<S>,
|
||||||
) -> Result<login::Response, Error> {
|
) -> Result<login::Response, Error> {
|
||||||
let request = login::Request {
|
let request = login::Request {
|
||||||
address: None,
|
user: login::UserInfo::MatrixId(user.into()),
|
||||||
login_type: login::LoginType::Password,
|
login_info: login::LoginInfo::Password {
|
||||||
medium: None,
|
password: password.into(),
|
||||||
|
},
|
||||||
device_id: device_id.map(|d| d.into()),
|
device_id: device_id.map(|d| d.into()),
|
||||||
password: password.into(),
|
initial_device_display_name: None,
|
||||||
user: user.into(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let response = self.send(request).await?;
|
let response = self.send(request).await?;
|
||||||
|
@ -456,9 +456,10 @@ impl AsyncClient {
|
||||||
request: Request,
|
request: Request,
|
||||||
) -> Result<<Request::Response as Outgoing>::Incoming, Error>
|
) -> Result<<Request::Response as Outgoing>::Incoming, Error>
|
||||||
where
|
where
|
||||||
Request::Incoming: TryFrom<http::Request<Vec<u8>>, Error = ruma_api::Error>,
|
Request::Incoming:
|
||||||
|
TryFrom<http::Request<Vec<u8>>, Error = ruma_api::error::FromHttpRequestError>,
|
||||||
<Request::Response as Outgoing>::Incoming:
|
<Request::Response as Outgoing>::Incoming:
|
||||||
TryFrom<http::Response<Vec<u8>>, Error = ruma_api::Error>,
|
TryFrom<http::Response<Vec<u8>>, Error = ruma_api::error::FromHttpResponseError>,
|
||||||
{
|
{
|
||||||
let request: http::Request<Vec<u8>> = request.try_into()?;
|
let request: http::Request<Vec<u8>> = request.try_into()?;
|
||||||
let url = request.uri();
|
let url = request.uri();
|
||||||
|
@ -520,8 +521,8 @@ impl AsyncClient {
|
||||||
&mut self,
|
&mut self,
|
||||||
room_id: &str,
|
room_id: &str,
|
||||||
data: MessageEventContent,
|
data: MessageEventContent,
|
||||||
) -> Result<send_message_event::Response, Error> {
|
) -> Result<create_message_event::Response, Error> {
|
||||||
let request = send_message_event::Request {
|
let request = create_message_event::Request {
|
||||||
room_id: RoomId::try_from(room_id).unwrap(),
|
room_id: RoomId::try_from(room_id).unwrap(),
|
||||||
event_type: EventType::RoomMessage,
|
event_type: EventType::RoomMessage,
|
||||||
txn_id: self.transaction_id().to_string(),
|
txn_id: self.transaction_id().to_string(),
|
||||||
|
|
22
src/error.rs
22
src/error.rs
|
@ -4,7 +4,8 @@ use std::error::Error as StdError;
|
||||||
use std::fmt::{Display, Formatter, Result as FmtResult};
|
use std::fmt::{Display, Formatter, Result as FmtResult};
|
||||||
|
|
||||||
use reqwest::Error as ReqwestError;
|
use reqwest::Error as ReqwestError;
|
||||||
use ruma_api::Error as RumaApiError;
|
use ruma_api::error::FromHttpResponseError as RumaResponseError;
|
||||||
|
use ruma_api::error::IntoHttpError as RumaIntoHttpError;
|
||||||
use serde_json::Error as SerdeJsonError;
|
use serde_json::Error as SerdeJsonError;
|
||||||
use serde_urlencoded::ser::Error as SerdeUrlEncodedSerializeError;
|
use serde_urlencoded::ser::Error as SerdeUrlEncodedSerializeError;
|
||||||
use url::ParseError;
|
use url::ParseError;
|
||||||
|
@ -19,7 +20,8 @@ impl Display for Error {
|
||||||
InnerError::AuthenticationRequired => "The queried endpoint requires authentication but was called with an anonymous client.",
|
InnerError::AuthenticationRequired => "The queried endpoint requires authentication but was called with an anonymous client.",
|
||||||
InnerError::Reqwest(_) => "An HTTP error occurred.",
|
InnerError::Reqwest(_) => "An HTTP error occurred.",
|
||||||
InnerError::Uri(_) => "Provided string could not be converted into a URI.",
|
InnerError::Uri(_) => "Provided string could not be converted into a URI.",
|
||||||
InnerError::RumaApi(_) => "An error occurred converting between ruma_client_api and hyper types.",
|
InnerError::RumaResponseError(_) => "An error occurred converting between ruma_client_api and hyper types.",
|
||||||
|
InnerError::IntoHttpError(_) => "An error occurred converting between ruma_client_api and hyper types.",
|
||||||
InnerError::SerdeJson(_) => "A serialization error occurred.",
|
InnerError::SerdeJson(_) => "A serialization error occurred.",
|
||||||
InnerError::SerdeUrlEncodedSerialize(_) => "An error occurred serializing data to a query string.",
|
InnerError::SerdeUrlEncodedSerialize(_) => "An error occurred serializing data to a query string.",
|
||||||
};
|
};
|
||||||
|
@ -40,7 +42,9 @@ pub(crate) enum InnerError {
|
||||||
/// An error when parsing a string as a URI.
|
/// An error when parsing a string as a URI.
|
||||||
Uri(ParseError),
|
Uri(ParseError),
|
||||||
/// An error converting between ruma_client_api types and Hyper types.
|
/// An error converting between ruma_client_api types and Hyper types.
|
||||||
RumaApi(RumaApiError),
|
RumaResponseError(RumaResponseError),
|
||||||
|
/// An error converting between ruma_client_api types and Hyper types.
|
||||||
|
IntoHttpError(RumaIntoHttpError),
|
||||||
/// An error when serializing or deserializing a JSON value.
|
/// An error when serializing or deserializing a JSON value.
|
||||||
SerdeJson(SerdeJsonError),
|
SerdeJson(SerdeJsonError),
|
||||||
/// An error when serializing a query string value.
|
/// An error when serializing a query string value.
|
||||||
|
@ -53,9 +57,15 @@ impl From<ParseError> for Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<RumaApiError> for Error {
|
impl From<RumaResponseError> for Error {
|
||||||
fn from(error: RumaApiError) -> Self {
|
fn from(error: RumaResponseError) -> Self {
|
||||||
Self(InnerError::RumaApi(error))
|
Self(InnerError::RumaResponseError(error))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<RumaIntoHttpError> for Error {
|
||||||
|
fn from(error: RumaIntoHttpError) -> Self {
|
||||||
|
Self(InnerError::IntoHttpError(error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue