Merge pull request #2289 from JL710/Component-doc
feature doc to Component trait
This commit is contained in:
commit
eada3b8bf2
5 changed files with 6 additions and 5 deletions
|
|
@ -29,6 +29,7 @@ use std::hash::{Hash, Hasher as H};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
/// A widget that only rebuilds its contents when necessary.
|
/// A widget that only rebuilds its contents when necessary.
|
||||||
|
#[cfg(feature = "lazy")]
|
||||||
#[allow(missing_debug_implementations)]
|
#[allow(missing_debug_implementations)]
|
||||||
pub struct Lazy<'a, Message, Theme, Renderer, Dependency, View> {
|
pub struct Lazy<'a, Message, Theme, Renderer, Dependency, View> {
|
||||||
dependency: Dependency,
|
dependency: Dependency,
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ use std::rc::Rc;
|
||||||
///
|
///
|
||||||
/// Additionally, a [`Component`] is capable of producing a `Message` to notify
|
/// Additionally, a [`Component`] is capable of producing a `Message` to notify
|
||||||
/// the parent application of any relevant interactions.
|
/// the parent application of any relevant interactions.
|
||||||
|
#[cfg(feature = "lazy")]
|
||||||
pub trait Component<Message, Theme = crate::Theme, Renderer = crate::Renderer> {
|
pub trait Component<Message, Theme = crate::Theme, Renderer = crate::Renderer> {
|
||||||
/// The internal state of this [`Component`].
|
/// The internal state of this [`Component`].
|
||||||
type State: Default;
|
type State: Default;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
use crate::core::{self, Element, Size};
|
use crate::core::{self, Element, Size};
|
||||||
use crate::lazy::component::{self, Component};
|
use crate::lazy::component;
|
||||||
use crate::lazy::{Lazy, Responsive};
|
|
||||||
|
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
|
|
||||||
|
pub use crate::lazy::{Component, Lazy, Responsive};
|
||||||
|
|
||||||
/// Creates a new [`Lazy`] widget with the given data `Dependency` and a
|
/// Creates a new [`Lazy`] widget with the given data `Dependency` and a
|
||||||
/// closure that can turn this data into a widget tree.
|
/// closure that can turn this data into a widget tree.
|
||||||
#[cfg(feature = "lazy")]
|
#[cfg(feature = "lazy")]
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ use std::ops::Deref;
|
||||||
///
|
///
|
||||||
/// A [`Responsive`] widget will always try to fill all the available space of
|
/// A [`Responsive`] widget will always try to fill all the available space of
|
||||||
/// its parent.
|
/// its parent.
|
||||||
|
#[cfg(feature = "lazy")]
|
||||||
#[allow(missing_debug_implementations)]
|
#[allow(missing_debug_implementations)]
|
||||||
pub struct Responsive<
|
pub struct Responsive<
|
||||||
'a,
|
'a,
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,6 @@ pub use helpers::*;
|
||||||
#[cfg(feature = "lazy")]
|
#[cfg(feature = "lazy")]
|
||||||
mod lazy;
|
mod lazy;
|
||||||
|
|
||||||
#[cfg(feature = "lazy")]
|
|
||||||
pub use crate::lazy::{Component, Lazy, Responsive};
|
|
||||||
|
|
||||||
#[cfg(feature = "lazy")]
|
#[cfg(feature = "lazy")]
|
||||||
pub use crate::lazy::helpers::*;
|
pub use crate::lazy::helpers::*;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue