summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-05 15:38:40 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-05 15:38:40 +0700
commitb64e8752056e526b95ad3c0ff2385000c1213698 (patch)
treea9631cbccff00b7f26c46edd6bdf7d8b7164a83b /graphics
parent9fe65ed729c75a8401765cf373345aaba93352ca (diff)
downloadiced-b64e8752056e526b95ad3c0ff2385000c1213698.tar.gz
iced-b64e8752056e526b95ad3c0ff2385000c1213698.tar.bz2
iced-b64e8752056e526b95ad3c0ff2385000c1213698.zip
Write missing documentation in `iced_graphics`
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/backend.rs1
-rw-r--r--graphics/src/lib.rs2
-rw-r--r--graphics/src/renderer.rs3
3 files changed, 5 insertions, 1 deletions
diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs
index b8ff5d21..7e0af2cc 100644
--- a/graphics/src/backend.rs
+++ b/graphics/src/backend.rs
@@ -16,6 +16,7 @@ pub trait Backend {
fn trim_measurements(&mut self) {}
}
+/// A graphics backend that supports text rendering.
pub trait Text {
/// The icon font of the backend.
const ICON_FONT: Font;
diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs
index dbd94e99..5b8defc5 100644
--- a/graphics/src/lib.rs
+++ b/graphics/src/lib.rs
@@ -4,7 +4,7 @@
//! ![The native path of the Iced ecosystem](https://github.com/hecrj/iced/blob/0525d76ff94e828b7b21634fa94a747022001c83/docs/graphs/native.png?raw=true)
//!
//! [`iced`]: https://github.com/hecrj/iced
-//#![deny(missing_docs)]
+#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
#![deny(unused_results)]
#![deny(unsafe_code)]
diff --git a/graphics/src/renderer.rs b/graphics/src/renderer.rs
index 69ed8775..c32eb471 100644
--- a/graphics/src/renderer.rs
+++ b/graphics/src/renderer.rs
@@ -1,3 +1,4 @@
+//! Create a renderer from a [`Backend`].
use crate::backend::{self, Backend};
use crate::{Primitive, Vector};
use iced_native::layout;
@@ -23,10 +24,12 @@ impl<B: Backend> Renderer<B> {
}
}
+ /// Returns the [`Backend`] of the [`Renderer`].
pub fn backend(&self) -> &B {
&self.backend
}
+ /// Enqueues the given [`Primitive`] in the [`Renderer`] for drawing.
pub fn draw_primitive(&mut self, primitive: Primitive) {
self.primitives.push(primitive);
}