summaryrefslogtreecommitdiff
path: root/src/view/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/mod.rs')
-rw-r--r--src/view/mod.rs6
1 files changed, 6 insertions, 0 deletions
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<T: VCardPropertyInputObject<Self>>: 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<Error>;
+ /// Returns the error as `Html`
fn render_error(&self) -> Html {
html!{
<>
@@ -32,6 +37,7 @@ pub trait VCardPropertyInputComponent<T: VCardPropertyInputObject<Self>>: Compon
}
}
+/// Weak link; Useful for being able to have a list of subcomponents.
pub struct WeakComponentLink<COMP: Component>(Rc<RefCell<Option<ComponentLink<COMP>>>>);
impl<COMP: Component> Clone for WeakComponentLink<COMP> {