mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 09:49:07 +01:00
Add some documentation
This commit is contained in:
parent
76a10abc47
commit
7d2d8f706d
4 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
//! A Telegram bot.
|
||||||
|
|
||||||
use reqwest::Client;
|
use reqwest::Client;
|
||||||
|
|
||||||
use crate::requests::RequestContext;
|
use crate::requests::RequestContext;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! POC implementation of update dispatching
|
//! Update dispatching.
|
||||||
|
|
||||||
pub mod filter;
|
pub mod filter;
|
||||||
pub mod handler;
|
pub mod handler;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Raw API functions.
|
||||||
|
|
||||||
use reqwest::Client;
|
use reqwest::Client;
|
||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
|
|
||||||
|
@ -59,6 +61,7 @@ mod stop_message_live_location;
|
||||||
mod unban_chat_member;
|
mod unban_chat_member;
|
||||||
mod unpin_chat_message;
|
mod unpin_chat_message;
|
||||||
|
|
||||||
|
/// A type that is returned from `Request::send_boxed`.
|
||||||
pub type ResponseResult<T> = Result<T, RequestError>;
|
pub type ResponseResult<T> = Result<T, RequestError>;
|
||||||
|
|
||||||
/// A request that can be sent to Telegram.
|
/// A request that can be sent to Telegram.
|
||||||
|
@ -71,8 +74,11 @@ pub trait Request {
|
||||||
async fn send_boxed(self) -> ResponseResult<Self::Output>;
|
async fn send_boxed(self) -> ResponseResult<Self::Output>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A context used to send all the requests.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct RequestContext<'a> {
|
pub struct RequestContext<'a> {
|
||||||
|
/// An HTTPS client.
|
||||||
pub client: &'a Client,
|
pub client: &'a Client,
|
||||||
|
/// A token of your bot.
|
||||||
pub token: &'a str,
|
pub token: &'a str,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Raw API structures.
|
||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
animation::Animation,
|
animation::Animation,
|
||||||
audio::Audio,
|
audio::Audio,
|
||||||
|
|
Loading…
Reference in a new issue