From 66f7d43dc98df96c8b19cfd2aef6dcdd4187316c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 5 Aug 2022 05:15:41 +0200 Subject: Write missing documentation in `iced_native` --- native/src/widget/action.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'native/src/widget/action.rs') diff --git a/native/src/widget/action.rs b/native/src/widget/action.rs index 21032dbb..766e902b 100644 --- a/native/src/widget/action.rs +++ b/native/src/widget/action.rs @@ -3,13 +3,17 @@ use crate::widget::Id; use iced_futures::MaybeSend; +/// An operation to be performed on the widget tree. +#[allow(missing_debug_implementations)] pub struct Action(Box>); impl Action { + /// Creates a new [`Action`] with the given [`Operation`]. pub fn new(operation: impl Operation + 'static) -> Self { Self(Box::new(operation)) } + /// Maps the output of an [`Action`] using the given function. pub fn map( self, f: impl Fn(T) -> A + 'static + MaybeSend + Sync, @@ -24,11 +28,13 @@ impl Action { })) } + /// Consumes the [`Action`] and returns the internal [`Operation`]. pub fn into_operation(self) -> Box> { self.0 } } +#[allow(missing_debug_implementations)] struct Map { operation: Box>, f: Box B>, -- cgit