mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Move Output
type and METHOD
const from Payload
s to Method
trait
This commit is contained in:
parent
4c2e8029a9
commit
b02f10e73c
1 changed files with 10 additions and 12 deletions
|
@ -109,17 +109,19 @@ pub type ResponseResult<T> = Result<T, crate::RequestError>;
|
|||
// async fn send_boxed(self) -> ResponseResult<Self::Output>;
|
||||
//}
|
||||
|
||||
pub trait Method {
|
||||
type Output;
|
||||
|
||||
const METHOD: &'static str;
|
||||
}
|
||||
|
||||
pub mod json {
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
|
||||
use crate::{Bot, network};
|
||||
use super::ResponseResult;
|
||||
use super::{ResponseResult, Method};
|
||||
|
||||
pub trait Payload: Serialize {
|
||||
type Output;
|
||||
|
||||
const METHOD: &'static str;
|
||||
}
|
||||
pub trait Payload: Serialize + Method {}
|
||||
|
||||
pub struct Request<'b, P> {
|
||||
pub(crate) bot: &'b Bot,
|
||||
|
@ -147,13 +149,9 @@ pub mod multipart {
|
|||
use reqwest::multipart;
|
||||
|
||||
use crate::{Bot, network};
|
||||
use super::ResponseResult;
|
||||
|
||||
pub trait Payload {
|
||||
type Output;
|
||||
|
||||
const METHOD: &'static str;
|
||||
use super::{ResponseResult, Method};
|
||||
|
||||
pub trait Payload: Method {
|
||||
fn payload(&self) -> multipart::Form;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue