Add some documentation

This commit is contained in:
Temirkhan Myrzamadi 2019-10-15 13:50:16 +06:00
parent 76a10abc47
commit 7d2d8f706d
4 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,5 @@
//! A Telegram bot.
use reqwest::Client;
use crate::requests::RequestContext;

View file

@ -1,4 +1,4 @@
//! POC implementation of update dispatching
//! Update dispatching.
pub mod filter;
pub mod handler;

View file

@ -1,3 +1,5 @@
//! Raw API functions.
use reqwest::Client;
use serde::de::DeserializeOwned;
@ -59,6 +61,7 @@ mod stop_message_live_location;
mod unban_chat_member;
mod unpin_chat_message;
/// A type that is returned from `Request::send_boxed`.
pub type ResponseResult<T> = Result<T, RequestError>;
/// A request that can be sent to Telegram.
@ -71,8 +74,11 @@ pub trait Request {
async fn send_boxed(self) -> ResponseResult<Self::Output>;
}
/// A context used to send all the requests.
#[derive(Debug, Clone)]
pub struct RequestContext<'a> {
/// An HTTPS client.
pub client: &'a Client,
/// A token of your bot.
pub token: &'a str,
}

View file

@ -1,3 +1,5 @@
//! Raw API structures.
pub use self::{
animation::Animation,
audio::Audio,