#[derive(Debug, Clone, Default, PartialEq, Eq)]
#[non_exhaustive]
pub struct Presentation {
pub title: Option<String>,
pub description: Option<String>,
pub icon: Option<Icon>,
pub tint: Option<Tint>,
}
impl Presentation {
pub fn title(mut self, title: impl Into<String>) -> Self {
self.title = Some(title.into());
self
}
pub fn title_opt(mut self, title: Option<impl Into<String>>) -> Self {
self.title = title.map(Into::into);
self
}
pub fn description(mut self, description: impl Into<String>) -> Self {
self.description = Some(description.into());
self
}
pub fn description_opt(mut self, description: Option<impl Into<String>>) -> Self {
self.description = description.map(Into::into);
self
}
pub fn icon(mut self, icon: impl Into<Option<Icon>>) -> Self {
self.icon = icon.into();
self
}
pub fn tint(mut self, tint: impl Into<Option<Tint>>) -> Self {
self.tint = tint.into();
self
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum Icon {
Link,
Enum,
Toggle,
Lock,
Globe,
Clock,
Tag,
Text,
Other(String),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub enum Tint {
Accent,
Neutral,
Positive,
Warning,
Danger,
}