1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
use super::*; /// Conversion helpers between CLI arguments and `euv-core` types. impl RenderArg { /// Converts a `RenderArg` into the core `RenderMode` enum. /// /// # Arguments /// /// - `Self` - CLI render mode argument. /// /// # Returns /// /// - `RenderMode` - Core rendering pipeline mode. #[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, } } /// Returns the CLI flag string forwarded to `euv` applications. /// /// # Arguments /// /// - `Self` - CLI render mode argument. /// /// # Returns /// /// - `&'static str` - Render flag token. #[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, } } }