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 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`
/// from scratch.

View file

@ -1,7 +1,16 @@
use crate::core::requests::form_builder::FormBuilder;
use crate::core::requests::{ChatId, RequestContext, Request, RequestFuture, ResponseResult};
use crate::core::types::Message;
use crate::core::network;
use crate::core::{
network,
types::Message,
requests::{
ChatId,
Request,
RequestFuture,
RequestContext,
ResponseResult,
form_builder::FormBuilder,
},
};
#[derive(Debug, Clone, Serialize)]
/// 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::requests::{
Request, RequestFuture, RequestContext, ResponseResult,
use crate::core::{
network,
types::User,
requests::{
Request,
RequestFuture,
RequestContext,
ResponseResult
},
};
use crate::core::types::User;
#[derive(Debug, Clone)]
/// 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::future::Future;
use reqwest::r#async::Client;
use reqwest::StatusCode;
use reqwest::{
r#async::Client, StatusCode
};
use serde::de::DeserializeOwned;
mod form_builder;
mod utils;
#[derive(Debug, Display)]
pub enum RequestError {
@ -90,4 +93,3 @@ pub mod send_message;
pub mod forward_message;
pub mod send_photo;
pub mod send_media_group;
mod utils;

View file

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

View file

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

View file

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