windjammer_ui/components/generated/
input.rs

1#![allow(clippy::all)]
2#![allow(noop_method_call)]
3use super::traits::Renderable;
4
5pub struct Input {
6    value: String,
7    placeholder: String,
8}
9
10impl Input {
11    #[inline]
12    pub fn new() -> Input {
13        Input {
14            value: "".to_string(),
15            placeholder: "".to_string(),
16        }
17    }
18    #[inline]
19    pub fn value(mut self, value: String) -> Input {
20        self.value = value;
21        self
22    }
23    #[inline]
24    pub fn placeholder(mut self, placeholder: String) -> Input {
25        self.placeholder = placeholder;
26        self
27    }
28}
29
30impl Renderable for Input {
31    #[inline]
32    fn render(self) -> String {
33        format!(
34            "<input class='wj-input' value='{}' placeholder='{}'/>",
35            self.value, self.placeholder
36        )
37    }
38}