summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-08-29 03:33:02 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-08-29 03:33:02 +0200
commit23d4d20e575f337ebeed083a4f874e67c5b5e516 (patch)
tree3ad51950a4e6a429a11c5194a1ca93451d552fb9 /src
parenta14b8bffc0037cc14f55b361b9591cf2657e6348 (diff)
downloadiced-23d4d20e575f337ebeed083a4f874e67c5b5e516.tar.gz
iced-23d4d20e575f337ebeed083a4f874e67c5b5e516.tar.bz2
iced-23d4d20e575f337ebeed083a4f874e67c5b5e516.zip
Write documentation for `Cache`
Diffstat (limited to 'src')
-rw-r--r--src/input.rs2
-rw-r--r--src/user_interface.rs14
2 files changed, 13 insertions, 3 deletions
diff --git a/src/input.rs b/src/input.rs
index 613d83f1..097fa730 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -1,4 +1,4 @@
-//! Map your system events into input events that Iced can understand.
+//! Map your system events into input events that the runtime can understand.
pub mod keyboard;
pub mod mouse;
diff --git a/src/user_interface.rs b/src/user_interface.rs
index f64fe74b..3482c9b9 100644
--- a/src/user_interface.rs
+++ b/src/user_interface.rs
@@ -5,10 +5,10 @@ use stretch::result;
/// A set of interactive graphical elements with a specific [`Layout`].
///
-/// Use this to build, update, and draw your GUI!
+/// It can be updated and drawn.
///
/// Iced tries to avoid dictating how to write your event loop. You are in
-/// charge of integrating Iced in your system in any way you want.
+/// charge of using this type in your system in any way you want.
///
/// [`Layout`]: struct.Layout.html
pub struct UserInterface<'a, Message, Renderer> {
@@ -280,6 +280,9 @@ impl<'a, Message, Renderer> UserInterface<'a, Message, Renderer> {
}
}
+/// Reusable data of a specific [`UserInterface`].
+///
+/// [`UserInterface`]: struct.UserInterface.html
#[derive(Debug, Clone)]
pub struct Cache {
hash: u64,
@@ -288,6 +291,13 @@ pub struct Cache {
}
impl Cache {
+ /// Creates an empty [`Cache`].
+ ///
+ /// You should use this to initialize a [`Cache`] before building your first
+ /// [`UserInterface`].
+ ///
+ /// [`Cache`]: struct.Cache.html
+ /// [`UserInterface`]: struct.UserInterface.html
pub fn new() -> Cache {
let root: Element<'_, (), ()> = Column::new().into();