diff options
author | 2023-05-11 15:40:57 +0200 | |
---|---|---|
committer | 2023-05-11 15:40:57 +0200 | |
commit | b60194844a0f81a864f00e0637b6a4d131194fc5 (patch) | |
tree | 5def42ae5254560125423dd0ba2bbc5439935a2b /widget/src/lazy.rs | |
parent | de638f44a5c62459008a5c024b39c2443b72bf25 (diff) | |
download | iced-b60194844a0f81a864f00e0637b6a4d131194fc5.tar.gz iced-b60194844a0f81a864f00e0637b6a4d131194fc5.tar.bz2 iced-b60194844a0f81a864f00e0637b6a4d131194fc5.zip |
Write missing documentation in `iced_widget`
Diffstat (limited to 'widget/src/lazy.rs')
-rw-r--r-- | widget/src/lazy.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/widget/src/lazy.rs b/widget/src/lazy.rs index b08ed8cb..0ad46865 100644 --- a/widget/src/lazy.rs +++ b/widget/src/lazy.rs @@ -26,6 +26,7 @@ use std::cell::RefCell; use std::hash::{Hash, Hasher as H}; use std::rc::Rc; +/// A widget that only rebuilds its contents when necessary. #[allow(missing_debug_implementations)] pub struct Lazy<'a, Message, Renderer, Dependency, View> { dependency: Dependency, @@ -41,6 +42,8 @@ where Dependency: Hash + 'a, View: Into<Element<'static, Message, Renderer>>, { + /// Creates a new [`Lazy`] widget with the given data `Dependency` and a + /// closure that can turn this data into a widget tree. pub fn new( dependency: Dependency, view: impl Fn(&Dependency) -> View + 'a, |