mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Clarify StatefulListener
docs a little
This commit is contained in:
parent
755ec44aea
commit
ea5eb16276
1 changed files with 5 additions and 7 deletions
|
@ -25,25 +25,23 @@ pub struct StatefulListener<St, Assf, Sf, Hauf, Thf> {
|
|||
|
||||
/// The function used as [`AsUpdateStream::as_stream`].
|
||||
///
|
||||
/// Must be of type `for<'a> &'a mut St -> impl Stream + 'a` and callable by
|
||||
/// `&mut`.
|
||||
/// Must implement `for<'a> FnMut(&'a mut St) -> impl Stream + 'a`.
|
||||
pub stream: Assf,
|
||||
|
||||
/// The function used as [`UpdateListener::stop_token`].
|
||||
///
|
||||
/// Must be of type `for<'a> &'a mut St -> impl StopToken`.
|
||||
/// Must implement `FnMut(&mut St) -> impl StopToken`.
|
||||
pub stop_token: Sf,
|
||||
|
||||
/// The function used as [`UpdateListener::hint_allowed_updates`].
|
||||
///
|
||||
/// Must be of type `for<'a, 'b> &'a mut St, &'b mut dyn Iterator<Item =
|
||||
/// AllowedUpdate> -> ()`.
|
||||
/// Must implement `FnMut(&mut St, &mut dyn Iterator<Item =
|
||||
/// AllowedUpdate>)`.
|
||||
pub hint_allowed_updates: Option<Hauf>,
|
||||
|
||||
/// The function used as [`UpdateListener::timeout_hint`].
|
||||
///
|
||||
/// Must be of type `for<'a> &'a St -> Option<Duration>` and callable by
|
||||
/// `&`.
|
||||
/// Must implement `Fn(&St) -> Option<Duration>`.
|
||||
pub timeout_hint: Option<Thf>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue