From b9d42a45a8ce491e5fa21a86db0799bcd731d0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 28 May 2020 01:46:17 +0200 Subject: [PATCH] Write documentation for `iced_glow` --- glow/src/lib.rs | 17 +++++++++++------ glow/src/settings.rs | 4 +--- glow/src/widget.rs | 5 +++++ graphics/Cargo.toml | 4 ++++ wgpu/src/settings.rs | 4 +--- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/glow/src/lib.rs b/glow/src/lib.rs index a32c787e..9e9564ca 100644 --- a/glow/src/lib.rs +++ b/glow/src/lib.rs @@ -1,7 +1,10 @@ -//#![deny(missing_docs)] +//! A [`glow`] renderer for [`iced_native`]. +//! +//! [`glow`]: https://github.com/grovesNL/glow +//! [`iced_native`]: https://github.com/hecrj/iced/tree/master/native +#![deny(missing_docs)] #![deny(missing_debug_implementations)] #![deny(unused_results)] -//#![forbid(unsafe_code)] #![forbid(rust_2018_idioms)] mod backend; @@ -19,15 +22,17 @@ pub use settings::Settings; pub(crate) use backend::Backend; pub(crate) use iced_graphics::Transformation; -pub type Renderer = iced_graphics::Renderer; - #[doc(no_inline)] pub use widget::*; -pub type Element<'a, Message> = iced_native::Element<'a, Message, Renderer>; - pub use iced_graphics::Viewport; pub use iced_native::{ Background, Color, Command, HorizontalAlignment, Length, Vector, VerticalAlignment, }; + +/// A [`glow`] graphics renderer for [`iced`]. +/// +/// [`glow`]: https://github.com/grovesNL/glow +/// [`iced`]: https://github.com/hecrj/iced +pub type Renderer = iced_graphics::Renderer; diff --git a/glow/src/settings.rs b/glow/src/settings.rs index 07b36938..dce30029 100644 --- a/glow/src/settings.rs +++ b/glow/src/settings.rs @@ -1,6 +1,4 @@ -//! Configure a [`Renderer`]. -//! -//! [`Renderer`]: struct.Renderer.html +//! Configure a renderer. pub use iced_graphics::Antialiasing; /// The settings of a [`Renderer`]. diff --git a/glow/src/widget.rs b/glow/src/widget.rs index 362465f4..9968092b 100644 --- a/glow/src/widget.rs +++ b/glow/src/widget.rs @@ -48,6 +48,11 @@ pub use canvas::Canvas; pub use iced_native::{Image, Space}; +/// A container that distributes its contents vertically. pub type Column<'a, Message> = iced_native::Column<'a, Message, Renderer>; + +/// A container that distributes its contents horizontally. pub type Row<'a, Message> = iced_native::Row<'a, Message, Renderer>; + +/// A paragraph of text. pub type Text = iced_native::Text; diff --git a/graphics/Cargo.toml b/graphics/Cargo.toml index 675bcb60..8e078d75 100644 --- a/graphics/Cargo.toml +++ b/graphics/Cargo.toml @@ -31,3 +31,7 @@ optional = true [dependencies.font-kit] version = "0.6" optional = true + +[package.metadata.docs.rs] +rustdoc-args = ["--cfg", "docsrs"] +all-features = true diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs index 05d301e7..8378d734 100644 --- a/wgpu/src/settings.rs +++ b/wgpu/src/settings.rs @@ -1,6 +1,4 @@ -//! Configure a [`Renderer`]. -//! -//! [`Renderer`]: struct.Renderer.html +//! Configure a renderer. pub use iced_graphics::Antialiasing; /// The settings of a [`Renderer`].