Created
April 29, 2020 17:22
-
-
Save luser/139722e44f5ddb0bcb4dd3c4a649ddba to your computer and use it in GitHub Desktop.
idle_timeout_reset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Create a `Future` that will resolve after `idle_period` has elapsed, along with an `IdleReset` that can be used to reset the time period or cancel the timeout. | |
/// | |
/// This can be used to trigger an event that should happen after a period of inactivity. Activity in this situation is indicated by calling | |
/// `idle_reset` on the returned `IdleReset`. The timeout can be cancelled by calling `cancel` on the `IdleReset`. | |
/// | |
/// Returns a tuple of (`IdleReset`, `Future`) | |
pub fn idle_timeout_reset( | |
idle_period: Duration, | |
) -> (IdleReset, impl Future<Output = bool> + Send + 'static) { | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment