1pub struct TextInput {
3 pub pairs: Vec<(String, String)>,
4}
5
6impl TextInput {
7 pub fn new(pairs: Vec<(String, String)>) -> Self {
8 Self { pairs }
9 }
10
11 pub fn from_str(texts: &[(&str, &str)]) -> Self {
12 Self::new(
13 texts.iter().map(|(s, t)| (s.to_string(), t.to_string())).collect(),
14 )
15 }
16}
17
18impl crate::commons::input::text::TextInput<'_> for TextInput {
19 type InputType = (String, String);
20
21 fn into_encode_input(self) -> Vec<Self::InputType> {
22 self.pairs
23 }
24}