Commit graph

1549 commits

Author SHA1 Message Date
Waffle Lapkin
a8306ec3ff Apply suggestions from code review
Co-authored-by: Hirrolot <hirrolot@gmail.com>
2021-06-25 16:57:24 +03:00
Waffle
00093664c7 Remove use of unstable feature (duration_zero)
The feature has been stabilized in 1.53.
2021-06-25 16:57:24 +03:00
Waffle
a5192a9ecb Clippy 2021-06-25 16:57:24 +03:00
Waffle
d745f9bdb1 Remove send! macro 2021-06-25 16:57:24 +03:00
Waffle
f0de55ad55 Add Dispatcher::setup_ctrlc_handler function.
This function sets up `^C` handler which shuts down dispatching.
2021-06-25 16:57:24 +03:00
Waffle
41a95079b2 Add Dispatcher::shutdown function
This function allows to gracefuly shutdown dispatching.
2021-06-25 16:57:24 +03:00
Waffle
eae2bced6d Simplify polling a little bit 2021-06-25 16:57:24 +03:00
Waffle
9f5a222ed7 Add UpdateListener::timeout_hint 2021-06-25 16:57:24 +03:00
Waffle
c288a540b9 Store fetched updates in polling::State
This way updates aren't lost when the stream is dropped.
2021-06-25 16:57:24 +03:00
Waffle
aeca45a579 Refactor UpdateListner trait
Instead of `Stream` super trait we now require `for<'a> AsUpdateStream<'a, E'>`
as a super trait. `AsUpdateStream` in turn provides `as_stream` function which
takes `&mut self` and returns `Self::Stream` (the trait is needed to workaround
lack of GAT).

This patch also adds a `stop` function that allows stopping the listener.

Since `UpdateListner` now isn't `Stream` and required methods, it's blanked
implementation for streams was removed.

`polling` and `polling_default` functions now also require `R: 'static`.
2021-06-25 16:57:24 +03:00
Hirrolot
0f857e944b feature = "nightly" => all(docsrs, feature = "nightly") 2021-06-18 22:17:08 +06:00
Hirrolot
6a7ad31fc9 Place the comment above feature(doc_cfg) 2021-06-18 22:07:37 +06:00
Hirrolot
74348b7236 Remove feature(external_doc) completely 2021-06-18 21:44:10 +06:00
Hirrolot
fb0b267b94 Fix the removed feature external_doc 2021-06-18 21:35:54 +06:00
Hirrolot
f4260ed078 Replace lockfree with flurry 2021-06-18 20:53:03 +06:00
Hirrolot
1d5859507a Remove feature(extended_key_value_attributes) 2021-05-20 21:54:41 +06:00
Waffle
9b34586a04 Normalize docs 2021-05-15 23:37:14 +03:00
Temirkhan Myrzamadi
c0e3064785 Fmt 2021-05-10 12:13:07 +06:00
Hirrolot
7f578a8918
Paraphrase src/utils/command.rs
Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>
2021-05-09 23:06:35 -07:00
Temirkhan Myrzamadi
cf3639f68b Document the "off" value as a command description 2021-05-10 08:55:43 +06:00
Temirkhan Myrzamadi
3b7ca4dabd Merge 2021-05-08 19:02:35 +06:00
Temirkhan Myrzamadi
27eda5759c RowNotFound -> DialogueNotFound 2021-05-08 19:00:38 +06:00
Hirrolot
de52ea25f9
Update src/dispatching/dialogue/storage/mod.rs
Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>
2021-05-08 05:43:34 -07:00
Hirrolot
80e1afaeed
Update src/dispatching/dialogue/storage/in_mem_storage.rs
Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>
2021-05-08 05:43:27 -07:00
Temirkhan Myrzamadi
d14e0a49e9 Merge branch 'fix-remove-dialogue-sqlite' of https://github.com/teloxide/teloxide into fix-remove-dialogue-sqlite 2021-05-08 18:41:53 +06:00
Temirkhan Myrzamadi
cb02b83520 Apply review suggestions 2021-05-08 18:41:34 +06:00
Hirrolot
94e61d3403
Refactor src/dispatching/dialogue/storage/redis_storage.rs
Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>
2021-05-08 05:39:18 -07:00
Temirkhan Myrzamadi
5585143ac2 Don't capitalise letters after dashes 2021-05-08 18:21:11 +06:00
Temirkhan Myrzamadi
721feb0082 Fix the tests 2021-05-08 17:38:03 +06:00
Temirkhan Myrzamadi
58c8015e78 Re-export InMemStorageError unconditionally 2021-05-08 17:25:53 +06:00
Temirkhan Myrzamadi
08bf40e555 Fail Storage::remove_dialogue if a dialogue doesn't exist 2021-05-08 17:21:24 +06:00
Temirkhan Myrzamadi
9e0de46918 Always remove a dialogue in SqliteStorage::remove_dialogue 2021-04-22 05:42:05 +06:00
Temirkhan Myrzamadi
17d14d2d53 Yet another dirty hack to please rustfmt 2021-04-05 21:19:29 +06:00
Temirkhan Myrzamadi
bc9972bdf2 Move the features section to lib.rs 2021-04-05 19:48:56 +06:00
Temirkhan Myrzamadi
bf8d2fa51b Paraphrase #[must_use] 2021-04-03 14:21:06 +06:00
Temirkhan Myrzamadi
44956a4f85 Add descriptions of #[must_use] in Storage 2021-04-03 13:28:26 +06:00
Temirkhan Myrzamadi
617c861d26 Mark all the functions of Storage as #[must_use] 2021-04-03 06:53:02 +06:00
Temirkhan Myrzamadi
fff0b670fb Fix RedisStorage::update_dialogue 2021-03-29 12:20:17 +06:00
Hirrolot
ca60e52f43
Update src/dispatching/dialogue/storage/redis_storage.rs
Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>
2021-03-28 22:18:47 -07:00
Hirrolot
75a36feca5
Merge branch 'dev' into fix-storage-persistency 2021-03-28 03:36:03 -07:00
Temirkhan Myrzamadi
68135d004f ToOwned<Owned = D> -> D: Clone 2021-03-28 16:30:12 +06:00
Temirkhan Myrzamadi
b7e2f14307 Automatically delete a webhook if it was set up 2021-03-28 08:51:57 +06:00
Temirkhan Myrzamadi
9b75378572 Fix the tests and examples 2021-03-28 08:20:35 +06:00
Temirkhan Myrzamadi
01b7b91bda Document how Storage failures are handled in DialogueDispatcher 2021-03-28 06:30:35 +06:00
Temirkhan Myrzamadi
abbbc41892 Fix RedisStorage, SqliteStorage 2021-03-28 06:20:13 +06:00
Temirkhan Myrzamadi
bf1ed601ac Fix the storage persistency bug 2021-03-28 05:34:25 +06:00
Temirkhan Myrzamadi
580dfaeae6 Merge branch 'dev' into clarify-storage-purpose 2021-03-22 01:35:14 +06:00
Waffle Lapkin
101528e453
Resolve fixme (#350)
* Update redis

* Resolve fixme(waffle) related to building docs

* Fix broken links

* Reexport teloxide_core::prelude as `no_inline`
2021-03-22 00:43:19 +06:00
Hirrolot
8522759e68
Get ready for v0.4.0 (#347)
* Get ready for v0.4.0

* Export teloxide_macros as macros in lib.rs

* Use tokio v1.3 in README.md

* Return the feature 'macros' back

* Export teloxide_macros::teloxide in the prelude

* Document the 'macros' feature in README.md

* Update src/lib.rs

Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>

* Update src/prelude.rs

Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>

* Propagate features from teloxide-core

* teloxide-core = 0.2.1

* Fix CI

* Require teloxide-core/auto_send instead of teloxide/auto-send

* default-features = false (teloxide-core)

* Specify each teloxide-core feature separately

* Fix Cargo.toml

* JSON -> Json, CBOR -> Cbor

* Update Cargo.toml

Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>

Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>
2021-03-21 18:34:23 +06:00
Hirrolot
68e3c5e089
Update src/prelude.rs
Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>
2021-03-20 22:57:32 +06:00