summaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-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);
+}