From 69ceb1f9ec68e41029759a6fcff3168adb6df373 Mon Sep 17 00:00:00 2001 From: jelemux Date: Thu, 4 Feb 2021 13:30:15 +0100 Subject: minor refactoring + comments --- src/view/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/view/mod.rs') diff --git a/src/view/mod.rs b/src/view/mod.rs index 7a64fed..d97c6e4 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -9,10 +9,15 @@ pub mod name; pub mod address; pub mod telephone; +/// Trait for types that represent an input component for a vcard property. pub trait VCardPropertyInputComponent>: Component { + /// Returns the object containing the input data. fn get_input_object(&self) -> T; + /// Getter function for the title of the component fn get_title(&self) -> String; + /// Getter function for an eventual error. fn get_error(&self) -> Option; + /// Returns the error as `Html` fn render_error(&self) -> Html { html!{ <> @@ -32,6 +37,7 @@ pub trait VCardPropertyInputComponent>: Compon } } +/// Weak link; Useful for being able to have a list of subcomponents. pub struct WeakComponentLink(Rc>>>); impl Clone for WeakComponentLink { -- cgit v1.2.3