2020-12-23 22:24:31 +06:00
|
|
|
//! Wrappers altering functionality of a bot.
|
2020-10-20 16:52:29 +03:00
|
|
|
//!
|
2020-12-23 22:24:31 +06:00
|
|
|
//! Bot adaptors are very similar to the [`Iterator`] adaptors: they are bots
|
|
|
|
//! wrapping other bots to alter existing or add new functionality.
|
2020-10-20 16:52:29 +03:00
|
|
|
//!
|
2020-12-23 23:40:58 +06:00
|
|
|
//! E.g. [`AutoSend`] allows `await`ing requests directly, no need to use
|
2020-12-23 22:24:31 +06:00
|
|
|
//! `.send()`.
|
2020-10-20 16:52:29 +03:00
|
|
|
//!
|
|
|
|
//! [`Requester`]: crate::requests::Requester
|
2020-10-20 15:33:22 +03:00
|
|
|
|
2021-01-15 21:51:15 +03:00
|
|
|
/// [`AutoSend`] bot adaptor which allows sending a request without calling
|
|
|
|
/// [`send`].
|
|
|
|
///
|
|
|
|
/// [`AutoSend`]: auto_send::AutoSend
|
|
|
|
/// [`send`]: crate::requests::Request::send
|
2020-10-20 15:33:22 +03:00
|
|
|
#[cfg(feature = "auto_send")]
|
|
|
|
pub mod auto_send;
|
2021-01-15 21:51:15 +03:00
|
|
|
|
|
|
|
/// [`CacheMe`] bot adaptor which caches [`GetMe`] requests.
|
|
|
|
///
|
|
|
|
/// [`CacheMe`]: cache_me::CacheMe
|
|
|
|
/// [`GetMe`]: crate::payloads::GetMe
|
2020-10-20 15:33:22 +03:00
|
|
|
#[cfg(feature = "cache_me")]
|
|
|
|
pub mod cache_me;
|
2021-01-15 21:51:15 +03:00
|
|
|
|
2021-07-10 17:41:20 +03:00
|
|
|
/// [`Trace`] bot adaptor which traces requests.
|
|
|
|
///
|
|
|
|
/// [`Trace`]: trace::Trace
|
|
|
|
#[cfg(feature = "trace_adaptor")]
|
|
|
|
pub mod trace;
|
|
|
|
|
2021-07-16 22:41:50 +03:00
|
|
|
/// [`ErasedRequester`] bot adaptor which allows to erase type of
|
2021-07-12 16:58:51 +03:00
|
|
|
/// [`Requester`].
|
|
|
|
///
|
|
|
|
/// [`ErasedRequester`]: erased::ErasedRequester
|
|
|
|
/// [`Requester`]: crate::requests::Requester
|
|
|
|
#[cfg(feature = "erased")]
|
|
|
|
pub mod erased;
|
|
|
|
|
2021-01-15 21:51:15 +03:00
|
|
|
/// [`Throttle`] bot adaptor which allows automatically throttle when hitting
|
|
|
|
/// API limits.
|
|
|
|
///
|
|
|
|
/// [`Throttle`]: throttle::Throttle
|
2020-10-20 15:33:22 +03:00
|
|
|
#[cfg(feature = "throttle")]
|
|
|
|
pub mod throttle;
|
|
|
|
|
2020-11-27 01:18:57 +03:00
|
|
|
mod parse_mode;
|
|
|
|
|
2020-10-20 16:52:29 +03:00
|
|
|
#[cfg(feature = "auto_send")]
|
|
|
|
pub use auto_send::AutoSend;
|
|
|
|
#[cfg(feature = "cache_me")]
|
|
|
|
pub use cache_me::CacheMe;
|
2021-07-12 16:58:51 +03:00
|
|
|
#[cfg(feature = "erased")]
|
|
|
|
pub use erased::ErasedRequester;
|
2020-10-20 16:52:29 +03:00
|
|
|
#[cfg(feature = "throttle")]
|
|
|
|
pub use throttle::Throttle;
|
2021-07-10 17:41:20 +03:00
|
|
|
#[cfg(feature = "trace_adaptor")]
|
|
|
|
pub use trace::Trace;
|
2020-10-20 15:33:22 +03:00
|
|
|
|
2020-11-27 01:18:57 +03:00
|
|
|
pub use parse_mode::DefaultParseMode;
|