Rename Request::ReturnValue to Request::Output

This commit is contained in:
Temirkhan Myrzamadi 2019-10-15 13:27:41 +06:00
parent a0212f8ae2
commit 76a10abc47
31 changed files with 62 additions and 62 deletions

View file

@ -38,9 +38,9 @@ pub struct AnswerPreCheckoutQuery<'a> {
#[async_trait]
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
}
}

View file

@ -39,9 +39,9 @@ pub struct AnswerShippingQuery<'a> {
#[async_trait]
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
}
}

View file

@ -43,9 +43,9 @@ pub struct EditMessageLiveLocation<'a> {
#[async_trait]
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
}
}

View file

@ -30,9 +30,9 @@ pub struct ForwardMessage<'a> {
#[async_trait]
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
}
}

View file

@ -21,9 +21,9 @@ pub struct GetChat<'a> {
#[async_trait]
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
}
}

View file

@ -23,9 +23,9 @@ pub struct GetFile<'a> {
#[async_trait]
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
}
}

View file

@ -15,9 +15,9 @@ pub struct GetMe<'a> {
#[async_trait]
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
}
}

View file

@ -31,9 +31,9 @@ pub enum AllowedUpdate {
#[async_trait]
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
}
}

View file

@ -26,9 +26,9 @@ pub struct GetUserProfilePhotos<'a> {
#[async_trait]
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
}
}

View file

@ -29,9 +29,9 @@ pub struct KickChatMember<'a> {
#[async_trait]
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
}
}

View file

@ -65,10 +65,10 @@ pub type ResponseResult<T> = Result<T, RequestError>;
#[async_trait]
pub trait Request {
/// A type of response.
type ReturnValue: DeserializeOwned;
type Output: DeserializeOwned;
/// Send this request.
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue>;
async fn send_boxed(self) -> ResponseResult<Self::Output>;
}
#[derive(Debug, Clone)]

View file

@ -50,8 +50,8 @@ impl<'a> PinChatMessage<'a> {
#[async_trait]
impl Request for PinChatMessage<'_> {
type ReturnValue = True;
async fn send_boxed(self) -> ResponseResult<Self::ReturnValue> {
type Output = True;
async fn send_boxed(self) -> ResponseResult<Self::Output> {
self.send().await
}
}

View file

@ -52,9 +52,9 @@ pub struct PromoteChatMember<'a> {
#[async_trait]
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
}
}

View file

@ -30,9 +30,9 @@ pub struct RestrictChatMember<'a> {
#[async_trait]
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
}
}

View file

@ -66,9 +66,9 @@ pub struct SendAnimation<'a> {
#[async_trait]
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
}
}

View file

@ -65,9 +65,9 @@ pub struct SendAudio<'a> {
#[async_trait]
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
}
}

View file

@ -27,9 +27,9 @@ pub struct SendChatAction<'a> {
#[async_trait]
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
}
}

View file

@ -44,9 +44,9 @@ pub struct SendContact<'a> {
#[async_trait]
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
}
}

View file

@ -59,9 +59,9 @@ pub struct SendDocument<'a> {
#[async_trait]
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
}
}

View file

@ -40,9 +40,9 @@ pub struct SendLocation<'a> {
#[async_trait]
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
}
}

View file

@ -22,9 +22,9 @@ pub struct SendMediaGroup<'a> {
#[async_trait]
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
}
}

View file

@ -45,9 +45,9 @@ pub struct SendMessage<'a> {
#[async_trait]
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
}
}

View file

@ -46,9 +46,9 @@ pub struct SendPhoto<'a> {
#[async_trait]
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
}
}

View file

@ -34,9 +34,9 @@ pub struct SendPoll<'a> {
#[async_trait]
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
}
}

View file

@ -49,9 +49,9 @@ pub struct SendVenue<'a> {
#[async_trait]
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
}
}

View file

@ -68,9 +68,9 @@ pub struct SendVideo<'a> {
#[async_trait]
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
}
}

View file

@ -55,9 +55,9 @@ pub struct SendVideoNote<'a> {
#[async_trait]
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
}
}

View file

@ -52,9 +52,9 @@ pub struct SendVoice<'a> {
#[async_trait]
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
}
}

View file

@ -34,9 +34,9 @@ pub struct StopMessageLiveLocation<'a> {
#[async_trait]
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
}
}

View file

@ -23,9 +23,9 @@ pub struct UnbanChatMember<'a> {
#[async_trait]
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
}
}

View file

@ -16,9 +16,9 @@ pub struct UnpinChatMessage<'a> {
#[async_trait]
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
}
}