summaryrefslogtreecommitdiffstats
path: root/native/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2019-11-24 11:34:30 +0100
committerLibravatar GitHub <noreply@github.com>2019-11-24 11:34:30 +0100
commit149fd2aa1fa86858c7c1dcec8fd844caa78cec94 (patch)
treea199cf8d2caaf6aa60e48e93d6dd0688969d43b0 /native/src/renderer.rs
parent9712b319bb7a32848001b96bd84977430f14b623 (diff)
parent47196c9007d12d3b3e0036ffabe3bf6d14ff4523 (diff)
downloadiced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.gz
iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.bz2
iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.zip
Merge pull request #65 from hecrj/improvement/docs
Documentation
Diffstat (limited to 'native/src/renderer.rs')
-rw-r--r--native/src/renderer.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/native/src/renderer.rs b/native/src/renderer.rs
index 833de571..7a68ada4 100644
--- a/native/src/renderer.rs
+++ b/native/src/renderer.rs
@@ -21,16 +21,32 @@
//! [`checkbox::Renderer`]: ../widget/checkbox/trait.Renderer.html
mod debugger;
+#[cfg(debug_assertions)]
+mod null;
mod windowed;
pub use debugger::Debugger;
+#[cfg(debug_assertions)]
+pub use null::Null;
pub use windowed::{Target, Windowed};
use crate::{layout, Element};
+/// A component that can take the state of a user interface and produce an
+/// output for its users.
pub trait Renderer: Sized {
+ /// The type of output of the [`Renderer`].
+ ///
+ /// If you are implementing a graphical renderer, your output will most
+ /// likely be a tree of visual primitives.
+ ///
+ /// [`Renderer`]: trait.Renderer.html
type Output;
+ /// Lays out the elements of a user interface.
+ ///
+ /// You should override this if you need to perform any operations before or
+ /// after layouting. For instance, trimming the measurements cache.
fn layout<'a, Message>(
&mut self,
element: &Element<'a, Message, Self>,