Skip to content

Fix broken doc links #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
/Cargo.lock
/.idea
15 changes: 9 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl Handle {
}

/// Create an interval controller which wakes up after specified `interval` duration on
/// every call to [`util::Interval::wait`]
/// every call to [`util::Interval::tick`]
pub fn interval(&self, interval: Duration) -> util::Interval {
util::Interval { handle: self.clone(), wakeup_time: Instant::now() + interval, interval }
}
Expand All @@ -345,7 +345,7 @@ pub mod util {
impl Interval {
/// Wait until next interval.
///
/// This function will return [`SleepResult`] which contains the duration that overly passed
/// This function will return [`Report`] which contains the duration that overly passed
/// the specified interval. As it internally aligns to the specified interval, it should not
/// be drifted over time, in terms of [`Instant`] clock domain.
///
Expand Down Expand Up @@ -374,7 +374,7 @@ pub mod util {
result
}

/// A shortcut for [`tick_with_min_interval`] with `minimum_interval` set to half.
/// A shortcut for [`Self::tick_with_min_interval`] with `minimum_interval` set to half.
pub async fn tick(&mut self) -> Report {
self.tick_with_min_interval(self.interval / 2).await
}
Expand Down Expand Up @@ -450,7 +450,7 @@ pub mod util {
self.interval = interval;
}

/// Shortcut for [`Self::align_clock`] from now.
/// Shortcut for [`Self::align_with_clock`] from now.
pub fn align_now(
&mut self,
interval: Option<Duration>,
Expand All @@ -465,7 +465,7 @@ pub mod util {
);
}

/// Shortcut for [`Self::align_clock`] with [`std::time::SystemTime`] as the time source.
/// Shortcut for [`Self::align_with_clock`] with [`std::time::SystemTime`] as the time source.
#[cfg(feature = "system-clock")]
pub fn align_with_system_clock(
&mut self,
Expand Down Expand Up @@ -523,7 +523,7 @@ pub enum Report {
/// Timer has not been requested as the timeout is already expired.
ExpiredTimer(Duration),

/// We woke up a bit earlier than required. It is usually hundreads of nanoseconds.
/// We woke up a bit earlier than required. It is usually hundreds of nanoseconds.
CompletedEarly(Duration),
}

Expand Down Expand Up @@ -559,7 +559,10 @@ impl Report {

#[derive(Debug)]
enum SleepState {
/// Initial state - waiting for first poll to register with driver
Pending(channel::Sender<driver::Event>),
/// Waiting for driver to wake.
/// Keeps driver's weak waker alive.
Sleeping(Arc<WakerNode>),
Woken,
}
Expand Down