diff --git a/src/window.rs b/src/window.rs index 87864352727..e074494af70 100644 --- a/src/window.rs +++ b/src/window.rs @@ -17,6 +17,7 @@ pub use cursor_icon::{CursorIcon, ParseError as CursorIconParseError}; /// Represents a window. /// +/// To close the [`Window`] it can be dropped. /// /// # Threading /// @@ -28,7 +29,6 @@ pub use cursor_icon::{CursorIcon, ParseError as CursorIconParseError}; /// window from a thread other than the main, the code is scheduled to run on /// the main thread, and your thread may be blocked until that completes. /// -/// /// # Example /// /// ```no_run @@ -52,6 +52,11 @@ pub use cursor_icon::{CursorIcon, ParseError as CursorIconParseError}; /// } /// }); /// ``` +/// +/// ## Platform-specific +/// +/// **Web:** The [`Window`], which is represented by a `HTMLElementCanvas`, can +/// not be closed by dropping the [`Window`]. pub struct Window { pub(crate) window: platform_impl::Window, } @@ -62,6 +67,9 @@ impl fmt::Debug for Window { } } +/// This will close the [`Window`]. +/// +/// See [`Window`] for more details. impl Drop for Window { fn drop(&mut self) { self.window.maybe_wait_on_main(|w| {