mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Rename Request::ReturnValue to Request::Output
This commit is contained in:
parent
a0212f8ae2
commit
76a10abc47
31 changed files with 62 additions and 62 deletions
|
@ -38,9 +38,9 @@ pub struct AnswerPreCheckoutQuery<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for AnswerPreCheckoutQuery<'_> {
|
impl Request for AnswerPreCheckoutQuery<'_> {
|
||||||
type ReturnValue = True;
|
type Output = True;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,9 +39,9 @@ pub struct AnswerShippingQuery<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for AnswerShippingQuery<'_> {
|
impl Request for AnswerShippingQuery<'_> {
|
||||||
type ReturnValue = True;
|
type Output = True;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,9 +43,9 @@ pub struct EditMessageLiveLocation<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for EditMessageLiveLocation<'_> {
|
impl Request for EditMessageLiveLocation<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@ pub struct ForwardMessage<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for ForwardMessage<'_> {
|
impl Request for ForwardMessage<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,9 +21,9 @@ pub struct GetChat<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for GetChat<'_> {
|
impl Request for GetChat<'_> {
|
||||||
type ReturnValue = Chat;
|
type Output = Chat;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,9 @@ pub struct GetFile<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for GetFile<'_> {
|
impl Request for GetFile<'_> {
|
||||||
type ReturnValue = File;
|
type Output = File;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,9 @@ pub struct GetMe<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for GetMe<'_> {
|
impl Request for GetMe<'_> {
|
||||||
type ReturnValue = User;
|
type Output = User;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,9 @@ pub enum AllowedUpdate {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for GetUpdates<'_> {
|
impl Request for GetUpdates<'_> {
|
||||||
type ReturnValue = Vec<Update>;
|
type Output = Vec<Update>;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,9 @@ pub struct GetUserProfilePhotos<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for GetUserProfilePhotos<'_> {
|
impl Request for GetUserProfilePhotos<'_> {
|
||||||
type ReturnValue = UserProfilePhotos;
|
type Output = UserProfilePhotos;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,9 @@ pub struct KickChatMember<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for KickChatMember<'_> {
|
impl Request for KickChatMember<'_> {
|
||||||
type ReturnValue = True;
|
type Output = True;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,10 +65,10 @@ pub type ResponseResult<T> = Result<T, RequestError>;
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait Request {
|
pub trait Request {
|
||||||
/// A type of response.
|
/// A type of response.
|
||||||
type ReturnValue: DeserializeOwned;
|
type Output: DeserializeOwned;
|
||||||
|
|
||||||
/// Send this request.
|
/// Send this request.
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue>;
|
async fn send_boxed(self) -> ResponseResult<Self::Output>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
|
@ -50,8 +50,8 @@ impl<'a> PinChatMessage<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for PinChatMessage<'_> {
|
impl Request for PinChatMessage<'_> {
|
||||||
type ReturnValue = True;
|
type Output = True;
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,9 +52,9 @@ pub struct PromoteChatMember<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for PromoteChatMember<'_> {
|
impl Request for PromoteChatMember<'_> {
|
||||||
type ReturnValue = True;
|
type Output = True;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@ pub struct RestrictChatMember<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for RestrictChatMember<'_> {
|
impl Request for RestrictChatMember<'_> {
|
||||||
type ReturnValue = True;
|
type Output = True;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,9 +66,9 @@ pub struct SendAnimation<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendAnimation<'_> {
|
impl Request for SendAnimation<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,9 +65,9 @@ pub struct SendAudio<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendAudio<'_> {
|
impl Request for SendAudio<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,9 @@ pub struct SendChatAction<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendChatAction<'_> {
|
impl Request for SendChatAction<'_> {
|
||||||
type ReturnValue = True;
|
type Output = True;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,9 +44,9 @@ pub struct SendContact<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendContact<'_> {
|
impl Request for SendContact<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,9 +59,9 @@ pub struct SendDocument<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendDocument<'_> {
|
impl Request for SendDocument<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,9 +40,9 @@ pub struct SendLocation<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendLocation<'_> {
|
impl Request for SendLocation<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,9 @@ pub struct SendMediaGroup<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendMediaGroup<'_> {
|
impl Request for SendMediaGroup<'_> {
|
||||||
type ReturnValue = Vec<Message>;
|
type Output = Vec<Message>;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,9 @@ pub struct SendMessage<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendMessage<'_> {
|
impl Request for SendMessage<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,9 +46,9 @@ pub struct SendPhoto<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendPhoto<'_> {
|
impl Request for SendPhoto<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,9 @@ pub struct SendPoll<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendPoll<'_> {
|
impl Request for SendPoll<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,9 +49,9 @@ pub struct SendVenue<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendVenue<'_> {
|
impl Request for SendVenue<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,9 +68,9 @@ pub struct SendVideo<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendVideo<'_> {
|
impl Request for SendVideo<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,9 +55,9 @@ pub struct SendVideoNote<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendVideoNote<'_> {
|
impl Request for SendVideoNote<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,9 +52,9 @@ pub struct SendVoice<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for SendVoice<'_> {
|
impl Request for SendVoice<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,9 @@ pub struct StopMessageLiveLocation<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for StopMessageLiveLocation<'_> {
|
impl Request for StopMessageLiveLocation<'_> {
|
||||||
type ReturnValue = Message;
|
type Output = Message;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,9 @@ pub struct UnbanChatMember<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for UnbanChatMember<'_> {
|
impl Request for UnbanChatMember<'_> {
|
||||||
type ReturnValue = bool;
|
type Output = bool;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,9 @@ pub struct UnpinChatMessage<'a> {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Request for UnpinChatMessage<'_> {
|
impl Request for UnpinChatMessage<'_> {
|
||||||
type ReturnValue = True;
|
type Output = True;
|
||||||
|
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
|
async fn send_boxed(self) -> ResponseResult<Self::Output> {
|
||||||
self.send().await
|
self.send().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue