Make requester methods doc nicer

This commit is contained in:
Waffle 2020-12-28 14:46:49 +03:00
parent 7cc79eda63
commit 93bc2e6fee

View file

@ -20,7 +20,7 @@ use crate::{
pub trait Requester { pub trait Requester {
type Err: std::error::Error + Send; type Err: std::error::Error + Send;
// This block is auto generated by `cg` <https://github.com/teloxide/cg> (9a82143). // This block is auto generated by `cg` <https://github.com/teloxide/cg> (de3765b).
// **DO NOT EDIT THIS BLOCK**, // **DO NOT EDIT THIS BLOCK**,
// edit `cg` instead. // edit `cg` instead.
@ -75,42 +75,42 @@ pub trait Requester {
type SendPhoto: Request<Payload = SendPhoto, Err = Self::Err>; type SendPhoto: Request<Payload = SendPhoto, Err = Self::Err>;
/// For telegram documentation see [`SendPhoto`] /// For Telegram documentation see [`SendPhoto`].
fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto
where where
C: Into<ChatId>; C: Into<ChatId>;
type SendAudio: Request<Payload = SendAudio, Err = Self::Err>; type SendAudio: Request<Payload = SendAudio, Err = Self::Err>;
/// For telegram documentation see [`SendAudio`] /// For Telegram documentation see [`SendAudio`].
fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio
where where
C: Into<ChatId>; C: Into<ChatId>;
type SendDocument: Request<Payload = SendDocument, Err = Self::Err>; type SendDocument: Request<Payload = SendDocument, Err = Self::Err>;
/// For telegram documentation see [`SendDocument`] /// For Telegram documentation see [`SendDocument`].
fn send_document<C>(&self, chat_id: C, document: InputFile) -> Self::SendDocument fn send_document<C>(&self, chat_id: C, document: InputFile) -> Self::SendDocument
where where
C: Into<ChatId>; C: Into<ChatId>;
type SendVideo: Request<Payload = SendVideo, Err = Self::Err>; type SendVideo: Request<Payload = SendVideo, Err = Self::Err>;
/// For telegram documentation see [`SendVideo`] /// For Telegram documentation see [`SendVideo`].
fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo
where where
C: Into<ChatId>; C: Into<ChatId>;
type SendAnimation: Request<Payload = SendAnimation, Err = Self::Err>; type SendAnimation: Request<Payload = SendAnimation, Err = Self::Err>;
/// For telegram documentation see [`SendAnimation`] /// For Telegram documentation see [`SendAnimation`].
fn send_animation<C>(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation fn send_animation<C>(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation
where where
C: Into<ChatId>; C: Into<ChatId>;
type SendVoice: Request<Payload = SendVoice, Err = Self::Err>; type SendVoice: Request<Payload = SendVoice, Err = Self::Err>;
/// For telegram documentation see [`SendVoice`] /// For Telegram documentation see [`SendVoice`].
fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice
where where
C: Into<ChatId>; C: Into<ChatId>;
@ -481,14 +481,14 @@ pub trait Requester {
type EditMessageCaption: Request<Payload = EditMessageCaption, Err = Self::Err>; type EditMessageCaption: Request<Payload = EditMessageCaption, Err = Self::Err>;
/// For telegram documentation see [`EditMessageCaption`] /// For Telegram documentation see [`EditMessageCaption`].
fn edit_message_caption<C>(&self, chat_id: C, message_id: i32) -> Self::EditMessageCaption fn edit_message_caption<C>(&self, chat_id: C, message_id: i32) -> Self::EditMessageCaption
where where
C: Into<ChatId>; C: Into<ChatId>;
type EditMessageCaptionInline: Request<Payload = EditMessageCaptionInline, Err = Self::Err>; type EditMessageCaptionInline: Request<Payload = EditMessageCaptionInline, Err = Self::Err>;
/// For telegram documentation see [`EditMessageCaptionInline`] /// For Telegram documentation see [`EditMessageCaptionInline`].
fn edit_message_caption_inline<I>( fn edit_message_caption_inline<I>(
&self, &self,
inline_message_id: I, inline_message_id: I,
@ -632,7 +632,7 @@ pub trait Requester {
type SendInvoice: Request<Payload = SendInvoice, Err = Self::Err>; type SendInvoice: Request<Payload = SendInvoice, Err = Self::Err>;
/// For telegram documentation see [`SendInvoice`] /// For Telegram documentation see [`SendInvoice`].
fn send_invoice<T, D, Pa, P, S, C, Pri>( fn send_invoice<T, D, Pa, P, S, C, Pri>(
&self, &self,
chat_id: i32, chat_id: i32,
@ -680,14 +680,14 @@ pub trait Requester {
type SendGame: Request<Payload = SendGame, Err = Self::Err>; type SendGame: Request<Payload = SendGame, Err = Self::Err>;
/// For telegram documentation see [`SendGame`] /// For Telegram documentation see [`SendGame`].
fn send_game<G>(&self, chat_id: u32, game_short_name: G) -> Self::SendGame fn send_game<G>(&self, chat_id: u32, game_short_name: G) -> Self::SendGame
where where
G: Into<String>; G: Into<String>;
type SetGameScore: Request<Payload = SetGameScore, Err = Self::Err>; type SetGameScore: Request<Payload = SetGameScore, Err = Self::Err>;
/// For telegram documentation see [`SetGameScore`] /// For Telegram documentation see [`SetGameScore`].
fn set_game_score( fn set_game_score(
&self, &self,
user_id: u32, user_id: u32,
@ -698,7 +698,7 @@ pub trait Requester {
type SetGameScoreInline: Request<Payload = SetGameScoreInline, Err = Self::Err>; type SetGameScoreInline: Request<Payload = SetGameScoreInline, Err = Self::Err>;
/// For telegram documentation see [`SetGameScoreInline`] /// For Telegram documentation see [`SetGameScoreInline`].
fn set_game_score_inline<I>( fn set_game_score_inline<I>(
&self, &self,
user_id: u32, user_id: u32,
@ -710,7 +710,7 @@ pub trait Requester {
type GetGameHighScores: Request<Payload = GetGameHighScores, Err = Self::Err>; type GetGameHighScores: Request<Payload = GetGameHighScores, Err = Self::Err>;
/// For telegram documentation see [`GetGameHighScores`] /// For Telegram documentation see [`GetGameHighScores`].
fn get_game_high_scores<T>(&self, user_id: u32, target: T) -> Self::GetGameHighScores fn get_game_high_scores<T>(&self, user_id: u32, target: T) -> Self::GetGameHighScores
where where
T: Into<TargetMessage>; T: Into<TargetMessage>;