impl Clone for {CacheMe<_>, DefaultParseMode<_>, Throttle<_>}

This commit is contained in:
Waffle 2021-03-30 12:17:49 +03:00
parent 8cd8ac96d9
commit 44a044af02
4 changed files with 9 additions and 0 deletions

View file

@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased]
### Added
- `impl Clone` for {`CacheMe<_>`, `DefaultParseMode<_>`, `Throttle<_>`} ([#75][pr75])
[pr75]: https://github.com/teloxide/teloxide-core/pull/75
### Fixed
- `GetChatAdministrators` output type `ChatMember` => `Vec<ChatMember>` ([#73][pr73])

View file

@ -18,6 +18,7 @@ use crate::{
///
/// Bot's user is hardly ever changed, so sometimes it's reasonable to cache
/// response from `get_me` method.
#[derive(Clone)]
pub struct CacheMe<B> {
bot: B,
me: Arc<OnceCell<Me>>,

View file

@ -6,6 +6,7 @@ use crate::{
/// Default parse mode adaptor, see
/// [`RequesterExt::parse_mode`](crate::requests::RequesterExt::parse_mode).
#[derive(Clone)]
pub struct DefaultParseMode<B> {
bot: B,
mode: ParseMode,

View file

@ -146,6 +146,7 @@ impl Default for Limits {
///
/// As such, we encourage not to use `ChatId::ChannelUsername(u)` with this bot
/// wrapper.
#[derive(Clone)]
pub struct Throttle<B> {
bot: B,
// `RequestLock` allows to unlock requests (allowing them to be sent).