Write missing docs and reenable deny statements
This commit is contained in:
parent
775500cf1f
commit
7b278755fc
18 changed files with 71 additions and 13 deletions
|
|
@ -34,7 +34,7 @@
|
|||
//! [`Windowed`]: renderer/trait.Windowed.html
|
||||
//! [`UserInterface`]: struct.UserInterface.html
|
||||
//! [renderer]: renderer/index.html
|
||||
//#![deny(missing_docs)]
|
||||
#![deny(missing_docs)]
|
||||
#![deny(missing_debug_implementations)]
|
||||
#![deny(unused_results)]
|
||||
#![deny(unsafe_code)]
|
||||
|
|
|
|||
|
|
@ -44,6 +44,11 @@ pub trait Renderer: Sized {
|
|||
/// [`Renderer`]: trait.Renderer.html
|
||||
type Output;
|
||||
|
||||
/// The default styling attributes of the [`Renderer`].
|
||||
///
|
||||
/// This type can be leveraged to implement style inheritance.
|
||||
///
|
||||
/// [`Renderer`]: trait.Renderer.html
|
||||
type Defaults: Default;
|
||||
|
||||
/// Lays out the elements of a user interface.
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ use crate::{
|
|||
pub struct Null;
|
||||
|
||||
impl Null {
|
||||
/// Creates a new [`Null`] renderer.
|
||||
///
|
||||
/// [`Null`]: struct.Null.html
|
||||
pub fn new() -> Null {
|
||||
Null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use raw_window_handle::HasRawWindowHandle;
|
|||
|
||||
/// A renderer that can target windows.
|
||||
pub trait Windowed: super::Renderer + Sized {
|
||||
/// The settings of the renderer.
|
||||
type Settings: Default;
|
||||
|
||||
/// The type of target.
|
||||
|
|
|
|||
|
|
@ -114,6 +114,9 @@ where
|
|||
self
|
||||
}
|
||||
|
||||
/// Sets the style of the [`Button`].
|
||||
///
|
||||
/// [`Button`]: struct.Button.html
|
||||
pub fn style(mut self, style: impl Into<Renderer::Style>) -> Self {
|
||||
self.style = style.into();
|
||||
self
|
||||
|
|
@ -246,6 +249,7 @@ where
|
|||
/// [`Button`]: struct.Button.html
|
||||
/// [renderer]: ../../renderer/index.html
|
||||
pub trait Renderer: crate::Renderer + Sized {
|
||||
/// The style supported by this renderer.
|
||||
type Style: Default;
|
||||
|
||||
/// Draws a [`Button`].
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ where
|
|||
/// [`Checkbox`]: struct.Checkbox.html
|
||||
/// [renderer]: ../../renderer/index.html
|
||||
pub trait Renderer: crate::Renderer {
|
||||
/// The style supported by this renderer.
|
||||
type Style: Default;
|
||||
|
||||
/// Returns the default size of a [`Checkbox`].
|
||||
|
|
|
|||
|
|
@ -183,7 +183,15 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
/// The renderer of a [`Container`].
|
||||
///
|
||||
/// Your [renderer] will need to implement this trait before being
|
||||
/// able to use a [`Container`] in your user interface.
|
||||
///
|
||||
/// [`Container`]: struct.Container.html
|
||||
/// [renderer]: ../../renderer/index.html
|
||||
pub trait Renderer: crate::Renderer {
|
||||
/// The style supported by this renderer.
|
||||
type Style: Default;
|
||||
|
||||
/// Draws a [`Container`].
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ where
|
|||
/// [`ProgressBar`]: struct.ProgressBar.html
|
||||
/// [renderer]: ../../renderer/index.html
|
||||
pub trait Renderer: crate::Renderer {
|
||||
/// The style supported by this renderer.
|
||||
type Style: Default;
|
||||
|
||||
/// The default height of a [`ProgressBar`].
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@ where
|
|||
/// [`Radio`]: struct.Radio.html
|
||||
/// [renderer]: ../../renderer/index.html
|
||||
pub trait Renderer: crate::Renderer {
|
||||
/// The style supported by this renderer.
|
||||
type Style: Default;
|
||||
|
||||
/// Returns the default size of a [`Radio`] button.
|
||||
|
|
|
|||
|
|
@ -458,6 +458,7 @@ pub struct Scroller {
|
|||
/// [`Scrollable`]: struct.Scrollable.html
|
||||
/// [renderer]: ../../renderer/index.html
|
||||
pub trait Renderer: crate::Renderer + Sized {
|
||||
/// The style supported by this renderer.
|
||||
type Style: Default;
|
||||
|
||||
/// Returns the [`Scrollbar`] given the bounds and content bounds of a
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ where
|
|||
/// [`Slider`]: struct.Slider.html
|
||||
/// [renderer]: ../../renderer/index.html
|
||||
pub trait Renderer: crate::Renderer {
|
||||
/// The style supported by this renderer.
|
||||
type Style: Default;
|
||||
|
||||
/// Returns the height of the [`Slider`].
|
||||
|
|
|
|||
|
|
@ -407,6 +407,7 @@ where
|
|||
/// [`TextInput`]: struct.TextInput.html
|
||||
/// [renderer]: ../../renderer/index.html
|
||||
pub trait Renderer: crate::Renderer + Sized {
|
||||
/// The style supported by this renderer.
|
||||
type Style: Default;
|
||||
|
||||
/// Returns the default size of the text of the [`TextInput`].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue