summaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-07-20 19:12:31 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-07-20 19:12:31 +0200
commit2b7ad3d50eae48b1963aa8e866e184c41133ca3d (patch)
treeae5b0c851aebb2dd8c01c08620d1cea7aa9d2466 /src/renderer.rs
parenteefdcbe06cce97b452ee71ccb6fcd1a423d29075 (diff)
downloadiced-2b7ad3d50eae48b1963aa8e866e184c41133ca3d.tar.gz
iced-2b7ad3d50eae48b1963aa8e866e184c41133ca3d.tar.bz2
iced-2b7ad3d50eae48b1963aa8e866e184c41133ca3d.zip
Decouple `iced` from `coffee`
Diffstat (limited to 'src/renderer.rs')
-rw-r--r--src/renderer.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
new file mode 100644
index 00000000..86e93a06
--- /dev/null
+++ b/src/renderer.rs
@@ -0,0 +1,15 @@
+use crate::Layout;
+
+pub trait Renderer {
+ type Color: Copy;
+
+ /// Explains the [`Layout`] of an [`Element`] for debugging purposes.
+ ///
+ /// This will be called when [`Element::explain`] has been used. It should
+ /// _explain_ the [`Layout`] graphically.
+ ///
+ /// [`Layout`]: struct.Layout.html
+ /// [`Element`]: struct.Element.html
+ /// [`Element::explain`]: struct.Element.html#method.explain
+ fn explain(&mut self, layout: &Layout<'_>, color: Self::Color);
+}