teloxide/src/adaptors.rs

61 lines
1.6 KiB
Rust
Raw Normal View History

2020-12-23 22:24:31 +06:00
//! Wrappers altering functionality of a bot.
//!
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-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()`.
//!
//! [`Requester`]: crate::requests::Requester
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
#[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
#[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
#[cfg(feature = "throttle")]
pub mod throttle;
mod parse_mode;
#[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;
#[cfg(feature = "throttle")]
pub use throttle::Throttle;
2021-07-10 17:41:20 +03:00
#[cfg(feature = "trace_adaptor")]
pub use trace::Trace;
pub use parse_mode::DefaultParseMode;