Skip to main content

iced_runtime/platform_specific/
mod.rs

1//! Platform-specific actions.
2//!
3//! This module provides actions for platform-specific features that
4//! aren't available through the standard iced API.
5
6use std::fmt;
7
8/// Wayland-specific actions
9#[cfg(all(
10    unix,
11    not(any(target_os = "macos", target_os = "ios", target_os = "android"))
12))]
13pub mod wayland;
14
15/// Platform-specific action.
16#[derive(Clone)]
17pub enum Action {
18    /// Wayland-specific action
19    #[cfg(all(
20        unix,
21        not(any(target_os = "macos", target_os = "ios", target_os = "android"))
22    ))]
23    Wayland(wayland::Action),
24}
25
26impl fmt::Debug for Action {
27    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
28        match self {
29            #[cfg(all(
30                unix,
31                not(any(target_os = "macos", target_os = "ios", target_os = "android"))
32            ))]
33            Action::Wayland(action) => f.debug_tuple("Wayland").field(action).finish(),
34            #[cfg(not(all(
35                unix,
36                not(any(target_os = "macos", target_os = "ios", target_os = "android"))
37            )))]
38            _ => Ok(()),
39        }
40    }
41}