iced_aw/widget/tab_bar/
tab_label.rs1#[allow(missing_debug_implementations)]
8#[derive(Clone, Hash)]
9pub enum TabLabel {
10 Icon(char),
12
13 Text(String),
15
16 IconText(char, String),
18 }
20
21impl From<char> for TabLabel {
22 fn from(value: char) -> Self {
23 Self::Icon(value)
24 }
25}
26
27impl From<&str> for TabLabel {
28 fn from(value: &str) -> Self {
29 Self::Text(value.to_owned())
30 }
31}
32
33impl From<String> for TabLabel {
34 fn from(value: String) -> Self {
35 Self::Text(value)
36 }
37}
38
39impl From<(char, &str)> for TabLabel {
40 fn from(value: (char, &str)) -> Self {
41 Self::IconText(value.0, value.1.to_owned())
42 }
43}
44
45impl From<(char, String)> for TabLabel {
46 fn from(value: (char, String)) -> Self {
47 Self::IconText(value.0, value.1)
48 }
49}