[INFO] cloning repository https://github.com/tristan/swaybar [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/tristan/swaybar" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftristan%2Fswaybar", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftristan%2Fswaybar'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 98250580baa7f304b56369f753ec1f42aae81a0a [INFO] checking tristan/swaybar against master#1f12b9b0fdbe735968ac002792a720f0ba4faca6 for crater-rollup-uwu [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftristan%2Fswaybar" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/tristan/swaybar on toolchain 1f12b9b0fdbe735968ac002792a720f0ba4faca6 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+1f12b9b0fdbe735968ac002792a720f0ba4faca6" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/tristan/swaybar [INFO] finished tweaking git repo https://github.com/tristan/swaybar [INFO] tweaked toml for git repo https://github.com/tristan/swaybar written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] crate git repo https://github.com/tristan/swaybar already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+1f12b9b0fdbe735968ac002792a720f0ba4faca6" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded wayland-scanner v0.28.5 [INFO] [stderr] Downloaded serde_with_macros v1.4.1 [INFO] [stderr] Downloaded wayland-commons v0.28.5 [INFO] [stderr] Downloaded wayland-sys v0.28.5 [INFO] [stderr] Downloaded serde_with v1.8.1 [INFO] [stderr] Downloaded wayland-client v0.28.5 [INFO] [stderr] Downloaded syn v1.0.71 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:923055f121b5182466d55868a8b05e67af8ba4a3a3f6bad814e953ca3cd3ac2a" "/opt/rustwide/cargo-home/bin/cargo" "+1f12b9b0fdbe735968ac002792a720f0ba4faca6" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] c0bad2af566d7264ca898588b768435d5af08ea69dcd9b25f33e316ffebb6afb [INFO] running `Command { std: "docker" "start" "-a" "c0bad2af566d7264ca898588b768435d5af08ea69dcd9b25f33e316ffebb6afb", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "c0bad2af566d7264ca898588b768435d5af08ea69dcd9b25f33e316ffebb6afb", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c0bad2af566d7264ca898588b768435d5af08ea69dcd9b25f33e316ffebb6afb", kill_on_drop: false }` [INFO] [stdout] c0bad2af566d7264ca898588b768435d5af08ea69dcd9b25f33e316ffebb6afb [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:923055f121b5182466d55868a8b05e67af8ba4a3a3f6bad814e953ca3cd3ac2a" "/opt/rustwide/cargo-home/bin/cargo" "+1f12b9b0fdbe735968ac002792a720f0ba4faca6" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 76324cb36048486b863e9b70e2cab2d079d2d63053653a93f5ceb64835ffdf02 [INFO] running `Command { std: "docker" "start" "-a" "76324cb36048486b863e9b70e2cab2d079d2d63053653a93f5ceb64835ffdf02", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.26 [INFO] [stderr] Compiling syn v1.0.71 [INFO] [stderr] Compiling libc v0.2.94 [INFO] [stderr] Compiling xml-rs v0.8.3 [INFO] [stderr] Compiling serde_derive v1.0.125 [INFO] [stderr] Compiling strsim v0.10.0 [INFO] [stderr] Compiling serde v1.0.125 [INFO] [stderr] Compiling rustversion v1.0.4 [INFO] [stderr] Compiling num-traits v0.2.14 [INFO] [stderr] Compiling wayland-sys v0.28.5 [INFO] [stderr] Compiling num-integer v0.1.44 [INFO] [stderr] Compiling crossbeam-utils v0.8.4 [INFO] [stderr] Checking once_cell v1.7.2 [INFO] [stderr] Checking smallvec v1.6.1 [INFO] [stderr] Compiling quote v1.0.9 [INFO] [stderr] Checking crossbeam-channel v0.5.1 [INFO] [stderr] Compiling wayland-scanner v0.28.5 [INFO] [stderr] Checking nix v0.20.0 [INFO] [stderr] Checking time v0.1.44 [INFO] [stderr] Checking chrono v0.4.19 [INFO] [stderr] Compiling wayland-client v0.28.5 [INFO] [stderr] Compiling swaybar v0.1.0 (/opt/rustwide/workdir) [INFO] [stderr] Compiling darling_core v0.12.4 [INFO] [stderr] Checking wayland-commons v0.28.5 [INFO] [stderr] Compiling darling_macro v0.12.4 [INFO] [stderr] Compiling darling v0.12.4 [INFO] [stderr] Compiling serde_with_macros v1.4.1 [INFO] [stderr] Checking serde_with v1.8.1 [INFO] [stderr] Checking serde_json v1.0.64 [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7352 [INFO] [stdout] | [INFO] [stdout] 1 | ... = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { addr_of!(super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface) as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7352 [INFO] [stdout] | [INFO] [stdout] 1 | ... = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { addr_of!(super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface) as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7497 [INFO] [stdout] | [INFO] [stdout] 1 | ...const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of t... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { addr_of!(super :: wl_seat :: wl_seat_interface) as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7497 [INFO] [stdout] | [INFO] [stdout] 1 | ...const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of t... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { addr_of!(super :: wl_seat :: wl_seat_interface) as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7849 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7849 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:8036 [INFO] [stdout] | [INFO] [stdout] 1 | ... , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation o... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { addr_of!(ext_idle_notifier_v1_requests_get_idle_notification_types) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:8036 [INFO] [stdout] | [INFO] [stdout] 1 | ... , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation o... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { addr_of!(ext_idle_notifier_v1_requests_get_idle_notification_types) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:8381 [INFO] [stdout] | [INFO] [stdout] 1 | ...t_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_me... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { addr_of!(ext_idle_notifier_v1_requests) as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:8381 [INFO] [stdout] | [INFO] [stdout] 1 | ...t_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_me... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { addr_of!(ext_idle_notifier_v1_requests) as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15192 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this i... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15192 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this i... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15510 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15510 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15680 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15680 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15986 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_no... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { addr_of!(ext_idle_notification_v1_requests) as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15986 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_no... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { addr_of!(ext_idle_notification_v1_requests) as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:16075 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { addr_of!(ext_idle_notification_v1_events) as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:16075 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { addr_of!(ext_idle_notification_v1_events) as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:5889 [INFO] [stdout] | [INFO] [stdout] 1 | ... * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDest... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(ext_idle_notifier_v1_interface) } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:5889 [INFO] [stdout] | [INFO] [stdout] 1 | ... * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDest... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(ext_idle_notifier_v1_interface) } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:14210 [INFO] [stdout] | [INFO] [stdout] 1 | ... const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notificat... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(ext_idle_notification_v1_interface) } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:14210 [INFO] [stdout] | [INFO] [stdout] 1 | ... const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notificat... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(ext_idle_notification_v1_interface) } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 12 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 12 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 13.07s [INFO] running `Command { std: "docker" "inspect" "76324cb36048486b863e9b70e2cab2d079d2d63053653a93f5ceb64835ffdf02", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "76324cb36048486b863e9b70e2cab2d079d2d63053653a93f5ceb64835ffdf02", kill_on_drop: false }` [INFO] [stdout] 76324cb36048486b863e9b70e2cab2d079d2d63053653a93f5ceb64835ffdf02 [INFO] checking tristan/swaybar against try#f9935d29d867449445ee008640ccca1bf1ae0889+rustflags=-Dtail_expr_drop_order for crater-rollup-uwu [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftristan%2Fswaybar" "/workspace/builds/worker-3-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/tristan/swaybar on toolchain f9935d29d867449445ee008640ccca1bf1ae0889 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+f9935d29d867449445ee008640ccca1bf1ae0889" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/tristan/swaybar [INFO] finished tweaking git repo https://github.com/tristan/swaybar [INFO] tweaked toml for git repo https://github.com/tristan/swaybar written to /workspace/builds/worker-3-tc2/source/Cargo.toml [INFO] crate git repo https://github.com/tristan/swaybar already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+f9935d29d867449445ee008640ccca1bf1ae0889" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:923055f121b5182466d55868a8b05e67af8ba4a3a3f6bad814e953ca3cd3ac2a" "/opt/rustwide/cargo-home/bin/cargo" "+f9935d29d867449445ee008640ccca1bf1ae0889" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 39117b70f6a425a206e7998619411e0ebde55911784702f273b12d4d93e0e9ff [INFO] running `Command { std: "docker" "start" "-a" "39117b70f6a425a206e7998619411e0ebde55911784702f273b12d4d93e0e9ff", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "39117b70f6a425a206e7998619411e0ebde55911784702f273b12d4d93e0e9ff", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "39117b70f6a425a206e7998619411e0ebde55911784702f273b12d4d93e0e9ff", kill_on_drop: false }` [INFO] [stdout] 39117b70f6a425a206e7998619411e0ebde55911784702f273b12d4d93e0e9ff [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid -Dtail_expr_drop_order" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:923055f121b5182466d55868a8b05e67af8ba4a3a3f6bad814e953ca3cd3ac2a" "/opt/rustwide/cargo-home/bin/cargo" "+f9935d29d867449445ee008640ccca1bf1ae0889" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 516d98e00c9fa9f2a449dcec929c8be68b83eb1f61de4b6aa4e1a89446a8669b [INFO] running `Command { std: "docker" "start" "-a" "516d98e00c9fa9f2a449dcec929c8be68b83eb1f61de4b6aa4e1a89446a8669b", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.26 [INFO] [stderr] Compiling syn v1.0.71 [INFO] [stderr] Compiling libc v0.2.94 [INFO] [stderr] Compiling xml-rs v0.8.3 [INFO] [stderr] Compiling strsim v0.10.0 [INFO] [stderr] Compiling serde_derive v1.0.125 [INFO] [stderr] Compiling serde v1.0.125 [INFO] [stderr] Compiling rustversion v1.0.4 [INFO] [stderr] Compiling wayland-sys v0.28.5 [INFO] [stderr] Compiling num-traits v0.2.14 [INFO] [stderr] Compiling num-integer v0.1.44 [INFO] [stderr] Compiling crossbeam-utils v0.8.4 [INFO] [stderr] Checking once_cell v1.7.2 [INFO] [stderr] Checking smallvec v1.6.1 [INFO] [stderr] Checking crossbeam-channel v0.5.1 [INFO] [stderr] Compiling quote v1.0.9 [INFO] [stderr] Compiling wayland-scanner v0.28.5 [INFO] [stderr] Checking nix v0.20.0 [INFO] [stderr] Checking time v0.1.44 [INFO] [stderr] Checking chrono v0.4.19 [INFO] [stderr] Compiling wayland-client v0.28.5 [INFO] [stderr] Compiling swaybar v0.1.0 (/opt/rustwide/workdir) [INFO] [stderr] Checking wayland-commons v0.28.5 [INFO] [stderr] Compiling darling_core v0.12.4 [INFO] [stderr] Compiling darling_macro v0.12.4 [INFO] [stderr] Compiling darling v0.12.4 [INFO] [stderr] Compiling serde_with_macros v1.4.1 [INFO] [stderr] Checking serde_json v1.0.64 [INFO] [stderr] Checking serde_with v1.8.1 [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7352 [INFO] [stdout] | [INFO] [stdout] 1 | ... = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { addr_of!(super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface) as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7352 [INFO] [stdout] | [INFO] [stdout] 1 | ... = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { addr_of!(super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface) as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7497 [INFO] [stdout] | [INFO] [stdout] 1 | ...const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of t... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { addr_of!(super :: wl_seat :: wl_seat_interface) as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7497 [INFO] [stdout] | [INFO] [stdout] 1 | ...const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of t... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { addr_of!(super :: wl_seat :: wl_seat_interface) as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7849 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:7849 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:8036 [INFO] [stdout] | [INFO] [stdout] 1 | ... , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation o... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { addr_of!(ext_idle_notifier_v1_requests_get_idle_notification_types) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:8036 [INFO] [stdout] | [INFO] [stdout] 1 | ... , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation o... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { addr_of!(ext_idle_notifier_v1_requests_get_idle_notification_types) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:8381 [INFO] [stdout] | [INFO] [stdout] 1 | ...t_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_me... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { addr_of!(ext_idle_notifier_v1_requests) as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:8381 [INFO] [stdout] | [INFO] [stdout] 1 | ...t_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_me... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { addr_of!(ext_idle_notifier_v1_requests) as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15192 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this i... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15192 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this i... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15510 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15510 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15680 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15680 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15986 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_no... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { addr_of!(ext_idle_notification_v1_requests) as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:15986 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_no... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { addr_of!(ext_idle_notification_v1_requests) as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:16075 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { addr_of!(ext_idle_notification_v1_events) as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:16075 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { addr_of!(ext_idle_notification_v1_events) as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:5889 [INFO] [stdout] | [INFO] [stdout] 1 | ... * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDest... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(ext_idle_notifier_v1_interface) } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:5889 [INFO] [stdout] | [INFO] [stdout] 1 | ... * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDest... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(ext_idle_notifier_v1_interface) } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:14210 [INFO] [stdout] | [INFO] [stdout] 1 | ... const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notificat... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(ext_idle_notification_v1_interface) } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:14210 [INFO] [stdout] | [INFO] [stdout] 1 | ... const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notificat... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior [INFO] [stdout] help: use `addr_of!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotifierV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ExtIdleNotificationV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(ext_idle_notification_v1_interface) } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/datetime.rs:13:11 [INFO] [stdout] | [INFO] [stdout] 8 | offset: u8, name: &str, sender: Sender<(u8, Block)> [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 13 | spawn(move || { [INFO] [stdout] | ___________^ [INFO] [stdout] 14 | | loop { [INFO] [stdout] 15 | | let dt: DateTime = Local::now(); [INFO] [stdout] 16 | | let full_text = dt.format(" %a %d-%b-%Y %R ").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 25 | | } [INFO] [stdout] 26 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] = note: requested on the command line with `-D tail-expr-drop-order` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/idle.rs:107:11 [INFO] [stdout] | [INFO] [stdout] 28 | offset: u8, name: &str, sender: Sender<(u8, Block)> [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 33 | let (s, r) = unbounded(); [INFO] [stdout] | - - these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | | [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 107 | spawn(move || { [INFO] [stdout] | ___________^ [INFO] [stdout] 108 | | let mut start = Instant::now(); [INFO] [stdout] 109 | | let mut has_reset = false; [INFO] [stdout] 110 | | let mut short_break_taken = false; [INFO] [stdout] ... | [INFO] [stdout] 204 | | } [INFO] [stdout] 205 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/idle.rs:62:36 [INFO] [stdout] | [INFO] [stdout] 61 | let s = s.clone(); [INFO] [stdout] | - these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 62 | pause.quick_assign(move |_timeout, event, _| { [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 63 | | match event { [INFO] [stdout] 64 | | Event::Idled => { [INFO] [stdout] 65 | | eprintln!(">>>> IDLE"); [INFO] [stdout] ... | [INFO] [stdout] 72 | | } [INFO] [stdout] 73 | | }) [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/idle.rs:78:42 [INFO] [stdout] | [INFO] [stdout] 77 | let s = s.clone(); [INFO] [stdout] | - these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 78 | short_break.quick_assign(move |_timeout, event, _| { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 79 | | match event { [INFO] [stdout] 80 | | Event::Idled => { [INFO] [stdout] 81 | | s.send(PauzaEvent::ShortBreakTaken).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 84 | | } [INFO] [stdout] 85 | | }) [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/datetime.rs:13:11 [INFO] [stdout] | [INFO] [stdout] 8 | offset: u8, name: &str, sender: Sender<(u8, Block)> [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 13 | spawn(move || { [INFO] [stdout] | ___________^ [INFO] [stdout] 14 | | loop { [INFO] [stdout] 15 | | let dt: DateTime = Local::now(); [INFO] [stdout] 16 | | let full_text = dt.format(" %a %d-%b-%Y %R ").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 25 | | } [INFO] [stdout] 26 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] = note: requested on the command line with `-D tail-expr-drop-order` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:6967 [INFO] [stdout] | [INFO] [stdout] 1 | ...1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap ... [INFO] [stdout] | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/idle.rs:107:11 [INFO] [stdout] | [INFO] [stdout] 28 | offset: u8, name: &str, sender: Sender<(u8, Block)> [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 33 | let (s, r) = unbounded(); [INFO] [stdout] | - - these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | | [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 107 | spawn(move || { [INFO] [stdout] | ___________^ [INFO] [stdout] 108 | | let mut start = Instant::now(); [INFO] [stdout] 109 | | let mut has_reset = false; [INFO] [stdout] 110 | | let mut short_break_taken = false; [INFO] [stdout] ... | [INFO] [stdout] 204 | | } [INFO] [stdout] 205 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/power.rs:90:11 [INFO] [stdout] | [INFO] [stdout] 54 | offset: u8, name: &str, sender: Sender<(u8, Block)> [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 90 | spawn(move || { [INFO] [stdout] | ___________^ [INFO] [stdout] 91 | | loop { [INFO] [stdout] 92 | | let mut full_text = String::new(); [INFO] [stdout] 93 | | full_text.push(' '); [INFO] [stdout] ... | [INFO] [stdout] 123 | | } [INFO] [stdout] 124 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/idle.rs:62:36 [INFO] [stdout] | [INFO] [stdout] 61 | let s = s.clone(); [INFO] [stdout] | - these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 62 | pause.quick_assign(move |_timeout, event, _| { [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 63 | | match event { [INFO] [stdout] 64 | | Event::Idled => { [INFO] [stdout] 65 | | eprintln!(">>>> IDLE"); [INFO] [stdout] ... | [INFO] [stdout] 72 | | } [INFO] [stdout] 73 | | }) [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/wifi.rs:36:11 [INFO] [stdout] | [INFO] [stdout] 30 | offset: u8, name: &str, sender: Sender<(u8, Block)> [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 36 | spawn(move || { [INFO] [stdout] | ___________^ [INFO] [stdout] 37 | | loop { [INFO] [stdout] 38 | | let mut full_text = String::new(); [INFO] [stdout] 39 | | full_text.push(' '); [INFO] [stdout] ... | [INFO] [stdout] 57 | | } [INFO] [stdout] 58 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/idle.rs:78:42 [INFO] [stdout] | [INFO] [stdout] 77 | let s = s.clone(); [INFO] [stdout] | - these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 78 | short_break.quick_assign(move |_timeout, event, _| { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 79 | | match event { [INFO] [stdout] 80 | | Event::Idled => { [INFO] [stdout] 81 | | s.send(PauzaEvent::ShortBreakTaken).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 84 | | } [INFO] [stdout] 85 | | }) [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> /opt/rustwide/target/debug/build/swaybar-a025378ec6f10d78/out/idle_client_api.rs:1:6967 [INFO] [stdout] | [INFO] [stdout] 1 | ...1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap ... [INFO] [stdout] | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/power.rs:90:11 [INFO] [stdout] | [INFO] [stdout] 54 | offset: u8, name: &str, sender: Sender<(u8, Block)> [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 90 | spawn(move || { [INFO] [stdout] | ___________^ [INFO] [stdout] 91 | | loop { [INFO] [stdout] 92 | | let mut full_text = String::new(); [INFO] [stdout] 93 | | full_text.push(' '); [INFO] [stdout] ... | [INFO] [stdout] 123 | | } [INFO] [stdout] 124 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021 [INFO] [stdout] --> src/wifi.rs:36:11 [INFO] [stdout] | [INFO] [stdout] 30 | offset: u8, name: &str, sender: Sender<(u8, Block)> [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 36 | spawn(move || { [INFO] [stdout] | ___________^ [INFO] [stdout] 37 | | loop { [INFO] [stdout] 38 | | let mut full_text = String::new(); [INFO] [stdout] 39 | | full_text.push(' '); [INFO] [stdout] ... | [INFO] [stdout] 57 | | } [INFO] [stdout] 58 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = warning: this changes meaning in Rust 2024 [INFO] [stdout] = note: for more information, see issue #123739 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to 7 previous errors; 12 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to 7 previous errors; 12 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `swaybar` (bin "swaybar" test) due to 8 previous errors; 12 warnings emitted [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] error: could not compile `swaybar` (bin "swaybar") due to 8 previous errors; 12 warnings emitted [INFO] running `Command { std: "docker" "inspect" "516d98e00c9fa9f2a449dcec929c8be68b83eb1f61de4b6aa4e1a89446a8669b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "516d98e00c9fa9f2a449dcec929c8be68b83eb1f61de4b6aa4e1a89446a8669b", kill_on_drop: false }` [INFO] [stdout] 516d98e00c9fa9f2a449dcec929c8be68b83eb1f61de4b6aa4e1a89446a8669b