mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +01:00
impl Clone
for {CacheMe<_>
, DefaultParseMode<_>
, Throttle<_>
}
This commit is contained in:
parent
8cd8ac96d9
commit
44a044af02
4 changed files with 9 additions and 0 deletions
|
@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [unreleased]
|
## [unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `impl Clone` for {`CacheMe<_>`, `DefaultParseMode<_>`, `Throttle<_>`} ([#75][pr75])
|
||||||
|
|
||||||
|
[pr75]: https://github.com/teloxide/teloxide-core/pull/75
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- `GetChatAdministrators` output type `ChatMember` => `Vec<ChatMember>` ([#73][pr73])
|
- `GetChatAdministrators` output type `ChatMember` => `Vec<ChatMember>` ([#73][pr73])
|
||||||
|
|
|
@ -18,6 +18,7 @@ use crate::{
|
||||||
///
|
///
|
||||||
/// Bot's user is hardly ever changed, so sometimes it's reasonable to cache
|
/// Bot's user is hardly ever changed, so sometimes it's reasonable to cache
|
||||||
/// response from `get_me` method.
|
/// response from `get_me` method.
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct CacheMe<B> {
|
pub struct CacheMe<B> {
|
||||||
bot: B,
|
bot: B,
|
||||||
me: Arc<OnceCell<Me>>,
|
me: Arc<OnceCell<Me>>,
|
||||||
|
|
|
@ -6,6 +6,7 @@ use crate::{
|
||||||
|
|
||||||
/// Default parse mode adaptor, see
|
/// Default parse mode adaptor, see
|
||||||
/// [`RequesterExt::parse_mode`](crate::requests::RequesterExt::parse_mode).
|
/// [`RequesterExt::parse_mode`](crate::requests::RequesterExt::parse_mode).
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct DefaultParseMode<B> {
|
pub struct DefaultParseMode<B> {
|
||||||
bot: B,
|
bot: B,
|
||||||
mode: ParseMode,
|
mode: ParseMode,
|
||||||
|
|
|
@ -146,6 +146,7 @@ impl Default for Limits {
|
||||||
///
|
///
|
||||||
/// As such, we encourage not to use `ChatId::ChannelUsername(u)` with this bot
|
/// As such, we encourage not to use `ChatId::ChannelUsername(u)` with this bot
|
||||||
/// wrapper.
|
/// wrapper.
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct Throttle<B> {
|
pub struct Throttle<B> {
|
||||||
bot: B,
|
bot: B,
|
||||||
// `RequestLock` allows to unlock requests (allowing them to be sent).
|
// `RequestLock` allows to unlock requests (allowing them to be sent).
|
||||||
|
|
Loading…
Add table
Reference in a new issue