Reorder uses in requests

This commit is contained in:
Waffle 2019-09-08 02:01:00 +03:00
parent 94c5320ca8
commit c3052ed036
7 changed files with 65 additions and 27 deletions

View file

@ -1,10 +1,13 @@
use std::path::PathBuf;
use crate::core::{
types::{ParseMode, InputMedia},
requests::{ChatId, utils},
};
use reqwest::r#async::multipart::Form; use reqwest::r#async::multipart::Form;
use serde::Serialize; use serde::Serialize;
use crate::core::types::ParseMode;
use crate::core::requests::ChatId;
use crate::core::requests::utils;
use crate::core::types::InputMedia;
use std::path::PathBuf;
/// This is a convenient struct that builds `reqwest::r#async::multipart::Form` /// This is a convenient struct that builds `reqwest::r#async::multipart::Form`
/// from scratch. /// from scratch.

View file

@ -1,7 +1,16 @@
use crate::core::requests::form_builder::FormBuilder; use crate::core::{
use crate::core::requests::{ChatId, RequestContext, Request, RequestFuture, ResponseResult}; network,
use crate::core::types::Message; types::Message,
use crate::core::network; requests::{
ChatId,
Request,
RequestFuture,
RequestContext,
ResponseResult,
form_builder::FormBuilder,
},
};
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
/// Use this method to forward messages of any kind. On success, the sent /// Use this method to forward messages of any kind. On success, the sent

View file

@ -1,8 +1,14 @@
use crate::core::network; use crate::core::{
use crate::core::requests::{ network,
Request, RequestFuture, RequestContext, ResponseResult, types::User,
requests::{
Request,
RequestFuture,
RequestContext,
ResponseResult
},
}; };
use crate::core::types::User;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
/// A simple method for testing your bot's auth token. Requires no parameters. /// A simple method for testing your bot's auth token. Requires no parameters.

View file

@ -1,11 +1,14 @@
use std::future::Future;
use std::pin::Pin; use std::pin::Pin;
use std::future::Future;
use reqwest::r#async::Client; use reqwest::{
use reqwest::StatusCode; r#async::Client, StatusCode
};
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
mod form_builder; mod form_builder;
mod utils;
#[derive(Debug, Display)] #[derive(Debug, Display)]
pub enum RequestError { pub enum RequestError {
@ -90,4 +93,3 @@ pub mod send_message;
pub mod forward_message; pub mod forward_message;
pub mod send_photo; pub mod send_photo;
pub mod send_media_group; pub mod send_media_group;
mod utils;

View file

@ -1,13 +1,13 @@
use crate::core::{ use crate::core::{
types::{Message, InputMedia, InputFile},
network::request_multipart, network::request_multipart,
types::{Message, InputMedia, InputFile},
requests::{ requests::{
form_builder::FormBuilder,
ChatId, ChatId,
Request, Request,
RequestContext,
RequestFuture, RequestFuture,
RequestContext,
ResponseResult, ResponseResult,
form_builder::FormBuilder,
} }
}; };
use apply::Apply; use apply::Apply;

View file

@ -1,6 +1,15 @@
use crate::core::requests::form_builder::FormBuilder; use crate::core::{
use crate::core::requests::{ network,
ChatId, Request, RequestFuture, RequestContext, ResponseResult, types::Message,
types::ParseMode,
requests::{
form_builder::FormBuilder,
ChatId,
Request,
RequestFuture,
RequestContext,
ResponseResult,
},
}; };

View file

@ -1,9 +1,18 @@
use std::path::Path; use std::path::Path;
use crate::core::requests::{RequestContext, ChatId, Request, RequestFuture, ResponseResult}; use crate::core::{
use crate::core::types::{ParseMode, Message, InputFile}; network,
use crate::core::requests::form_builder::FormBuilder; types::{ParseMode, Message, InputFile},
use crate::core::network; requests::{
ChatId,
Request,
RequestFuture,
RequestContext,
ResponseResult,
form_builder::FormBuilder,
},
};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
/// Use this method to send photos. On success, the sent [`Message`] is returned. /// Use this method to send photos. On success, the sent [`Message`] is returned.