Clarify StatefulListener docs a little

This commit is contained in:
Maybe Waffle 2022-01-25 20:35:06 +03:00
parent 755ec44aea
commit ea5eb16276

View file

@ -25,25 +25,23 @@ pub struct StatefulListener<St, Assf, Sf, Hauf, Thf> {
/// The function used as [`AsUpdateStream::as_stream`]. /// The function used as [`AsUpdateStream::as_stream`].
/// ///
/// Must be of type `for<'a> &'a mut St -> impl Stream + 'a` and callable by /// Must implement `for<'a> FnMut(&'a mut St) -> impl Stream + 'a`.
/// `&mut`.
pub stream: Assf, pub stream: Assf,
/// The function used as [`UpdateListener::stop_token`]. /// 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, pub stop_token: Sf,
/// The function used as [`UpdateListener::hint_allowed_updates`]. /// The function used as [`UpdateListener::hint_allowed_updates`].
/// ///
/// Must be of type `for<'a, 'b> &'a mut St, &'b mut dyn Iterator<Item = /// Must implement `FnMut(&mut St, &mut dyn Iterator<Item =
/// AllowedUpdate> -> ()`. /// AllowedUpdate>)`.
pub hint_allowed_updates: Option<Hauf>, pub hint_allowed_updates: Option<Hauf>,
/// The function used as [`UpdateListener::timeout_hint`]. /// 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>, pub timeout_hint: Option<Thf>,
} }