mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +01:00
Improve docs of FilterDispatcher
This commit is contained in:
parent
410c1cc8d8
commit
117094e9d0
1 changed files with 13 additions and 8 deletions
|
@ -16,14 +16,19 @@ type FiltersWithHandlers<'a, T, E> = Vec<FilterWithHandler<'a, T, E>>;
|
||||||
|
|
||||||
/// A dispatcher based on filters.
|
/// A dispatcher based on filters.
|
||||||
///
|
///
|
||||||
/// This is 'filter' implementation with following limitations:
|
/// Filters and handlers are executed in order of registering. The pseudocode
|
||||||
/// - Error (`E` generic parameter) _must_ implement [`std::fmt::Debug`]
|
/// looks like this:
|
||||||
/// - All 'handlers' are boxed
|
///
|
||||||
/// - Handler's fututres are also boxed
|
/// ```
|
||||||
/// - All handlers executed in order (this means that in dispatching have 2
|
/// for pair in handlers_and_filters {
|
||||||
/// upadtes it will first execute some handler into complition with first
|
/// if pair.filter.test(update) {
|
||||||
/// update and **then** search for handler for second update, this is probably
|
/// pair.handle(update);
|
||||||
/// wrong)
|
/// return;
|
||||||
|
/// }
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// log("unhandeled update: " + update);
|
||||||
|
/// ```
|
||||||
///
|
///
|
||||||
/// ## Examples
|
/// ## Examples
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Reference in a new issue