Skip to content

Commit 72bd822

Browse files
committed
Add missing docs
1 parent ed6211f commit 72bd822

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎src/handler.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub trait WindowHandler: 'static {
8686
/// The goal is for all external update logic to be contained within this method.
8787
/// Therefore, this method will be called in various cases, including (but not limited to):
8888
///
89-
/// * As a result of calling [`Window::request_poll`], at the platform's earliest convenience;
89+
/// * As a result of calling [`Window::request_poll`] or [`WindowWaker::request_poll`], at the platform's earliest convenience;
9090
/// * Whenever a new frame has been scheduled, right before actually calling [`WindowHandler::draw`].
9191
///
9292
/// This all means that this method will be invoked very regularly, possibly multiple times per frame interval.

‎src/waker.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
use std::time::Duration;
22

3+
/// A simple, weak handle to the [`Window`](crate::Window), which can be used to "wake" it from
4+
/// external events or threads.
5+
///
6+
/// It can be cheaply [cloned](Clone) and [send](Send) to be used from other threads with minimal
7+
/// overhead.
38
#[derive(Clone)]
49
pub struct WindowWaker {
510
pub(crate) inner: crate::platform::WindowWaker,
@@ -12,14 +17,18 @@ const _: () = {
1217
};
1318

1419
impl WindowWaker {
20+
/// Schedules a new frame to be drawn.
1521
pub fn request_redraw(&self) {
1622
self.inner.request_redraw()
1723
}
1824

25+
/// Schedules a new frame to be drawn after the given `duration`.
1926
pub fn request_redraw_after(&self, duration: Duration) {
2027
self.inner.request_redraw_after(duration)
2128
}
2229

30+
/// Schedules a call to the [`WindowHandler::poll`](crate::WindowHandler::poll) callback, at
31+
/// the platform's earliest convenience.
2332
pub fn request_poll(&self) {
2433
self.inner.request_poll()
2534
}

0 commit comments

Comments
 (0)