Write documentation for iced_glutin

This commit is contained in:
Héctor Ramón Jiménez 2020-05-28 02:57:03 +02:00
parent ef28347f1c
commit 4aa0d7a13a
4 changed files with 23 additions and 7 deletions

View File

@ -1,12 +1,18 @@
//! Create interactive, native cross-platform applications.
use crate::{mouse, Executor, Runtime, Size}; use crate::{mouse, Executor, Runtime, Size};
use iced_graphics::window; use iced_graphics::window;
use iced_graphics::Viewport; use iced_graphics::Viewport;
use iced_winit::application; use iced_winit::application;
use iced_winit::conversion; use iced_winit::conversion;
use iced_winit::{program, Clipboard, Debug, Proxy, Settings}; use iced_winit::{Clipboard, Debug, Proxy, Settings};
pub use iced_winit::Application; pub use iced_winit::Application;
pub use iced_winit::{program, Program};
/// Runs an [`Application`] with an executor, compositor, and the provided
/// settings.
///
/// [`Application`]: trait.Application.html
pub fn run<A, E, C>( pub fn run<A, E, C>(
settings: Settings<A::Flags>, settings: Settings<A::Flags>,
compositor_settings: C::Settings, compositor_settings: C::Settings,

View File

@ -1,15 +1,23 @@
//#![deny(missing_docs)] //! A windowing shell for [`iced`], on top of [`glutin`].
//!
//! [`iced`]: https://github.com/hecrj/iced
//! [`glutin`]: https://github.com/rust-windowing/glutin
#![deny(missing_docs)]
#![deny(missing_debug_implementations)] #![deny(missing_debug_implementations)]
#![deny(unused_results)] #![deny(unused_results)]
#![deny(unsafe_code)] #![deny(unsafe_code)]
#![forbid(rust_2018_idioms)] #![forbid(rust_2018_idioms)]
pub use glutin;
#[doc(no_inline)] #[doc(no_inline)]
pub use iced_native::*; pub use iced_native::*;
pub mod application; pub mod application;
pub use application::Application; pub use iced_winit::settings;
pub use iced_winit::settings::{self, Settings};
pub use iced_winit::Mode; pub use iced_winit::Mode;
#[doc(no_inline)]
pub use application::Application;
#[doc(no_inline)]
pub use settings::Settings;

View File

@ -5,7 +5,7 @@ mod state;
pub use state::State; pub use state::State;
/// An interactive, native cross-platform program. /// The core of a user interface application following The Elm Architecture.
pub trait Program: Sized { pub trait Program: Sized {
/// The graphics backend to use to draw the [`Program`]. /// The graphics backend to use to draw the [`Program`].
/// ///

View File

@ -18,6 +18,8 @@ use iced_native::program::{self, Program};
/// ///
/// When using an [`Application`] with the `debug` feature enabled, a debug view /// When using an [`Application`] with the `debug` feature enabled, a debug view
/// can be toggled by pressing `F12`. /// can be toggled by pressing `F12`.
///
/// [`Application`]: trait.Application.html
pub trait Application: Program { pub trait Application: Program {
/// The data needed to initialize your [`Application`]. /// The data needed to initialize your [`Application`].
/// ///
@ -36,7 +38,7 @@ pub trait Application: Program {
/// ///
/// [`Application`]: trait.Application.html /// [`Application`]: trait.Application.html
/// [`run`]: #method.run.html /// [`run`]: #method.run.html
/// [`Settings`]: struct.Settings.html /// [`Settings`]: ../settings/struct.Settings.html
fn new(flags: Self::Flags) -> (Self, Command<Self::Message>); fn new(flags: Self::Flags) -> (Self, Command<Self::Message>);
/// Returns the current title of the [`Application`]. /// Returns the current title of the [`Application`].