Flag lazy feature types directly

Co-authored-by: JL710 <76447362+JL710@users.noreply.github.com>
This commit is contained in:
Héctor Ramón Jiménez 2024-09-05 14:46:11 +02:00
parent 14e686cd37
commit 7cb12e3c3b
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 6 additions and 5 deletions

View file

@ -29,6 +29,7 @@ use std::hash::{Hash, Hasher as H};
use std::rc::Rc;
/// A widget that only rebuilds its contents when necessary.
#[cfg(feature = "lazy")]
#[allow(missing_debug_implementations)]
pub struct Lazy<'a, Message, Theme, Renderer, Dependency, View> {
dependency: Dependency,

View file

@ -30,6 +30,7 @@ use std::rc::Rc;
///
/// Additionally, a [`Component`] is capable of producing a `Message` to notify
/// the parent application of any relevant interactions.
#[cfg(feature = "lazy")]
pub trait Component<Message, Theme = crate::Theme, Renderer = crate::Renderer> {
/// The internal state of this [`Component`].
type State: Default;

View file

@ -1,9 +1,10 @@
use crate::core::{self, Element, Size};
use crate::lazy::component::{self, Component};
use crate::lazy::{Lazy, Responsive};
use crate::lazy::component;
use std::hash::Hash;
pub use crate::lazy::{Component, Lazy, Responsive};
/// Creates a new [`Lazy`] widget with the given data `Dependency` and a
/// closure that can turn this data into a widget tree.
#[cfg(feature = "lazy")]

View file

@ -21,6 +21,7 @@ use std::ops::Deref;
///
/// A [`Responsive`] widget will always try to fill all the available space of
/// its parent.
#[cfg(feature = "lazy")]
#[allow(missing_debug_implementations)]
pub struct Responsive<
'a,

View file

@ -42,9 +42,6 @@ pub use helpers::*;
#[cfg(feature = "lazy")]
mod lazy;
#[cfg(feature = "lazy")]
pub use crate::lazy::{Component, Lazy, Responsive};
#[cfg(feature = "lazy")]
pub use crate::lazy::helpers::*;