Re-export ruma_client_api from ruma_client

This commit is contained in:
Jonas Platte 2019-07-21 01:41:52 +02:00
parent cfaabe9486
commit a71b286dcd
2 changed files with 9 additions and 9 deletions

View File

@ -4,6 +4,7 @@ use std::{convert::TryFrom, env, process::exit};
use ruma_client::{ use ruma_client::{
self, self,
api::r0,
events::{ events::{
room::message::{MessageEventContent, MessageType, TextMessageEventContent}, room::message::{MessageEventContent, MessageType, TextMessageEventContent},
EventType, EventType,
@ -11,7 +12,6 @@ use ruma_client::{
identifiers::RoomAliasId, identifiers::RoomAliasId,
Client, Client,
}; };
use ruma_client_api::r0;
use url::Url; use url::Url;
async fn hello_world(homeserver_url: Url, room: String) -> Result<(), ruma_client::Error> { async fn hello_world(homeserver_url: Url, room: String) -> Result<(), ruma_client::Error> {

View File

@ -126,6 +126,7 @@ use url::Url;
use crate::error::InnerError; use crate::error::InnerError;
pub use crate::{error::Error, session::Session}; pub use crate::{error::Error, session::Session};
pub use ruma_client_api as api;
pub use ruma_events as events; pub use ruma_events as events;
pub use ruma_identifiers as identifiers; pub use ruma_identifiers as identifiers;
@ -225,7 +226,7 @@ where
password: String, password: String,
device_id: Option<String>, device_id: Option<String>,
) -> Result<Session, Error> { ) -> Result<Session, Error> {
use ruma_client_api::r0::session::login; use api::r0::session::login;
let response = self let response = self
.request(login::Request { .request(login::Request {
@ -252,7 +253,7 @@ where
/// this method stores the session data returned by the endpoint in this /// this method stores the session data returned by the endpoint in this
/// client, instead of returning it. /// client, instead of returning it.
pub async fn register_guest(&self) -> Result<Session, Error> { pub async fn register_guest(&self) -> Result<Session, Error> {
use ruma_client_api::r0::account::register; use api::r0::account::register;
let response = self let response = self
.request(register::Request { .request(register::Request {
@ -289,7 +290,7 @@ where
username: Option<String>, username: Option<String>,
password: String, password: String,
) -> Result<Session, Error> { ) -> Result<Session, Error> {
use ruma_client_api::r0::account::register; use api::r0::account::register;
let response = self let response = self
.request(register::Request { .request(register::Request {
@ -320,13 +321,12 @@ where
/// the logged-in users account and are visible to them. /// the logged-in users account and are visible to them.
pub fn sync( pub fn sync(
&self, &self,
filter: Option<ruma_client_api::r0::sync::sync_events::Filter>, filter: Option<api::r0::sync::sync_events::Filter>,
since: Option<String>, since: Option<String>,
set_presence: bool, set_presence: bool,
) -> impl Stream<Item = Result<ruma_client_api::r0::sync::sync_events::Response, Error>> ) -> impl Stream<Item = Result<api::r0::sync::sync_events::Response, Error>>
+ TryStream<Ok = ruma_client_api::r0::sync::sync_events::Response, Error = Error> + TryStream<Ok = api::r0::sync::sync_events::Response, Error = Error> {
{ use api::r0::sync::sync_events;
use ruma_client_api::r0::sync::sync_events;
// TODO: Is this really the way TryStreams are supposed to work? // TODO: Is this really the way TryStreams are supposed to work?
#[derive(Debug, PartialEq, Eq)] #[derive(Debug, PartialEq, Eq)]