use super::*;
impl RenderArg {
#[must_use]
pub const fn to_render_mode(self) -> RenderMode {
match self {
Self::Auto => RenderMode::Auto,
Self::Software => RenderMode::Software,
Self::Hardware => RenderMode::Hardware,
Self::Hybrid => RenderMode::Hybrid,
}
}
#[must_use]
pub const fn as_flag(self) -> &'static str {
match self {
Self::Auto => RENDER_FLAG_AUTO,
Self::Software => RENDER_FLAG_SOFTWARE,
Self::Hardware => RENDER_FLAG_HARDWARE,
Self::Hybrid => RENDER_FLAG_HYBRID,
}
}
}
impl HarmonyFormFactorArg {
#[must_use]
pub const fn as_str(self) -> &'static str {
match self {
Self::Phone => HARMONY_FORM_PHONE,
Self::Tablet => HARMONY_FORM_TABLET,
Self::Pc => HARMONY_FORM_PC,
Self::Foldable => HARMONY_FORM_FOLDABLE,
Self::Tv => HARMONY_FORM_TV,
Self::Car => HARMONY_FORM_CAR,
Self::Wearable => HARMONY_FORM_WEARABLE,
}
}
}
impl TargetArg {
#[must_use]
pub const fn is_group(self) -> bool {
matches!(
self,
Self::Desktop
| Self::Mobile
| Self::Apple
| Self::Terminal
| Self::HarmonyAll
| Self::Wearables
| Self::Miniapps
| Self::Quickapps
| Self::All
)
}
}
impl ProjectTemplateArg {
#[must_use]
pub const fn as_str(self) -> &'static str {
match self {
Self::App => TEMPLATE_NAME_APP,
Self::Web => TEMPLATE_NAME_WEB,
Self::DynamicWidget => TEMPLATE_NAME_DYNAMIC_WIDGET,
Self::Docs => TEMPLATE_NAME_DOCS,
}
}
}
impl ShellKindArg {
#[must_use]
pub const fn as_str(self) -> &'static str {
match self {
Self::Bash => SHELL_NAME_BASH,
Self::Zsh => SHELL_NAME_ZSH,
Self::Fish => SHELL_NAME_FISH,
Self::Powershell => SHELL_NAME_POWERSHELL,
}
}
}