[INFO] cloning repository https://github.com/Drakulix/fireplace [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Drakulix/fireplace" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDrakulix%2Ffireplace", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDrakulix%2Ffireplace'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 0358e029d18883d31d5a716a3e926177307f1ddb [INFO] checking Drakulix/fireplace/0358e029d18883d31d5a716a3e926177307f1ddb against try#4d98531622e1718ae0bc3c7a1ab9cd8938428452+rustflags=-Dtail_expr_drop_order for pr-129604 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDrakulix%2Ffireplace" "/workspace/builds/worker-1-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/Drakulix/fireplace on toolchain 4d98531622e1718ae0bc3c7a1ab9cd8938428452 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+4d98531622e1718ae0bc3c7a1ab9cd8938428452" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/Drakulix/fireplace [INFO] finished tweaking git repo https://github.com/Drakulix/fireplace [INFO] tweaked toml for git repo https://github.com/Drakulix/fireplace written to /workspace/builds/worker-1-tc2/source/Cargo.toml [INFO] crate git repo https://github.com/Drakulix/fireplace 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" "+4d98531622e1718ae0bc3c7a1ab9cd8938428452" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: `default_features` is deprecated in favor of `default-features` and will not work in the 2024 edition [INFO] [stderr] (in the `image` dependency) [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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" "+4d98531622e1718ae0bc3c7a1ab9cd8938428452" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 6f38c7b6379b602d0171ba3a706f9b21bf72bcf5e1cb1cf8f8a23a18099273b1 [INFO] running `Command { std: "docker" "start" "-a" "6f38c7b6379b602d0171ba3a706f9b21bf72bcf5e1cb1cf8f8a23a18099273b1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "6f38c7b6379b602d0171ba3a706f9b21bf72bcf5e1cb1cf8f8a23a18099273b1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "6f38c7b6379b602d0171ba3a706f9b21bf72bcf5e1cb1cf8f8a23a18099273b1", kill_on_drop: false }` [INFO] [stdout] 6f38c7b6379b602d0171ba3a706f9b21bf72bcf5e1cb1cf8f8a23a18099273b1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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" "+4d98531622e1718ae0bc3c7a1ab9cd8938428452" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 7c07817ab53f27af5eb80e5a73b1f56d4e3d1895a0691332fb63c73a0d9827c4 [INFO] running `Command { std: "docker" "start" "-a" "7c07817ab53f27af5eb80e5a73b1f56d4e3d1895a0691332fb63c73a0d9827c4", kill_on_drop: false }` [INFO] [stderr] warning: `default_features` is deprecated in favor of `default-features` and will not work in the 2024 edition [INFO] [stderr] (in the `image` dependency) [INFO] [stderr] Compiling libc v0.2.103 [INFO] [stderr] Compiling proc-macro2 v1.0.29 [INFO] [stderr] Compiling pkg-config v0.3.20 [INFO] [stderr] Compiling xml-rs v0.8.4 [INFO] [stderr] Checking once_cell v1.8.0 [INFO] [stderr] Checking smallvec v1.7.0 [INFO] [stderr] Checking scopeguard v1.1.0 [INFO] [stderr] Checking libloading v0.7.1 [INFO] [stderr] Compiling num-traits v0.2.14 [INFO] [stderr] Compiling syn v1.0.80 [INFO] [stderr] Compiling memchr v2.4.1 [INFO] [stderr] Compiling nom v7.0.0 [INFO] [stderr] Compiling num-integer v0.1.44 [INFO] [stderr] Compiling parking_lot_core v0.8.5 [INFO] [stderr] Compiling slog v2.7.0 [INFO] [stderr] Compiling log v0.4.14 [INFO] [stderr] Checking instant v0.1.11 [INFO] [stderr] Compiling crossbeam-queue v0.3.2 [INFO] [stderr] Checking minimal-lexical v0.1.4 [INFO] [stderr] Compiling drm-sys v0.1.1 [INFO] [stderr] Checking crossbeam-epoch v0.9.5 [INFO] [stderr] Checking lock_api v0.4.5 [INFO] [stderr] Checking dlib v0.5.0 [INFO] [stderr] Compiling drm-fourcc v2.2.0 [INFO] [stderr] Compiling input-sys v1.16.0 [INFO] [stderr] Compiling serde_derive v1.0.130 [INFO] [stderr] Compiling gbm-sys v0.2.0 [INFO] [stderr] Compiling indexmap v1.7.0 [INFO] [stderr] Compiling num-iter v0.1.42 [INFO] [stderr] Compiling num-rational v0.3.2 [INFO] [stderr] Checking crossbeam-deque v0.8.1 [INFO] [stderr] Compiling serde v1.0.130 [INFO] [stderr] Compiling wayland-sys v0.28.6 [INFO] [stderr] Compiling wayland-sys v0.29.0 [INFO] [stderr] Compiling libudev-sys v0.1.4 [INFO] [stderr] Compiling x11-dl v2.19.1 [INFO] [stderr] Compiling libdbus-sys v0.2.2 [INFO] [stderr] Compiling cgmath v0.18.0 [INFO] [stderr] Checking crossbeam v0.8.1 [INFO] [stderr] Checking arc-swap v1.4.0 [INFO] [stderr] Compiling winit v0.25.0 [INFO] [stderr] Checking thread_local v1.1.3 [INFO] [stderr] Checking slog-scope v4.4.0 [INFO] [stderr] Checking remove_dir_all v0.5.3 [INFO] [stderr] Compiling gl_generator v0.14.0 [INFO] [stderr] Compiling anyhow v1.0.44 [INFO] [stderr] Checking hashbrown v0.11.2 [INFO] [stderr] Compiling slog-async v2.7.0 [INFO] [stderr] Compiling quote v1.0.10 [INFO] [stderr] Checking slog-stdlog v4.1.0 [INFO] [stderr] Checking yaml-rust v0.4.5 [INFO] [stderr] Checking take_mut v0.2.2 [INFO] [stderr] Checking bytemuck v1.7.2 [INFO] [stderr] Checking byteorder v1.4.3 [INFO] [stderr] Checking appendlist v1.4.0 [INFO] [stderr] Checking scan_fmt v0.2.6 [INFO] [stderr] Checking color_quant v1.1.0 [INFO] [stderr] Checking dtoa v0.4.8 [INFO] [stderr] Checking edid-rs v0.1.0 [INFO] [stderr] Compiling wayland-scanner v0.28.6 [INFO] [stderr] Compiling wayland-scanner v0.29.0 [INFO] [stderr] Checking approx v0.4.0 [INFO] [stderr] Compiling smithay v0.3.0 (https://github.com/Smithay/smithay?rev=dd6919dd5fb1ac6571a3e7dff01b12a2102131fe#dd6919dd) [INFO] [stderr] Checking nix v0.22.2 [INFO] [stderr] Checking nix v0.20.2 [INFO] [stderr] Checking dirs v1.0.5 [INFO] [stderr] Checking getrandom v0.2.3 [INFO] [stderr] Checking xdg v2.3.0 [INFO] [stderr] Checking nix v0.18.0 [INFO] [stderr] Checking rand_core v0.6.3 [INFO] [stderr] Checking parking_lot v0.11.2 [INFO] [stderr] Checking andrew v0.3.1 [INFO] [stderr] Checking dirs-sys-next v0.1.2 [INFO] [stderr] Checking mio v0.7.13 [INFO] [stderr] Checking memmap2 v0.1.0 [INFO] [stderr] Checking time v0.1.43 [INFO] [stderr] Compiling wayland-client v0.29.0 [INFO] [stderr] Compiling wayland-server v0.29.0 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Compiling wayland-protocols v0.29.0 [INFO] [stderr] Checking udev v0.6.2 [INFO] [stderr] Checking dirs-next v2.0.0 [INFO] [stderr] Checking rand v0.8.4 [INFO] [stderr] Checking raw-window-handle v0.3.3 [INFO] [stderr] Checking chrono v0.4.19 [INFO] [stderr] Checking input v0.6.0 [INFO] [stderr] Compiling wayland-client v0.28.6 [INFO] [stderr] Compiling wayland-protocols v0.28.6 [INFO] [stderr] Checking mio-misc v1.2.1 [INFO] [stderr] Compiling fireplace v0.0.0 (/opt/rustwide/workdir) [INFO] [stderr] Checking tempfile v3.2.0 [INFO] [stderr] Checking term v0.7.0 [INFO] [stderr] Checking xkbcommon v0.4.0 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking xcursor v0.3.4 [INFO] [stderr] Checking dbus v0.9.5 [INFO] [stderr] Checking image v0.23.14 [INFO] [stderr] Checking slog-term v2.8.0 [INFO] [stderr] Checking calloop v0.6.5 [INFO] [stderr] Checking wayland-commons v0.29.0 [INFO] [stderr] Checking drm-ffi v0.2.0 [INFO] [stderr] Checking calloop v0.9.1 [INFO] [stderr] Checking wayland-commons v0.28.6 [INFO] [stderr] Checking drm v0.5.0 [INFO] [stderr] Checking gbm v0.7.0 [INFO] [stderr] Compiling thiserror-impl v1.0.30 [INFO] [stderr] Checking wayland-cursor v0.28.6 [INFO] [stderr] Checking wayland-egl v0.29.0 [INFO] [stderr] Checking thiserror v1.0.30 [INFO] [stderr] Checking serde_yaml v0.8.21 [INFO] [stderr] Checking smithay-client-toolkit v0.12.3 [INFO] [stdout] warning: unused imports: `cell::RefCell` and `rc::Rc` [INFO] [stdout] --> src/main.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cell::RefCell, fs::OpenOptions, path::PathBuf, rc::Rc}; [INFO] [stdout] | ^^^^^^^^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `backend::input::KeyState` [INFO] [stdout] --> src/handler/keyboard.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | backend::input::KeyState, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `LayerShellRequest`, `LayerSurfaceAttributes`, and `Serial` [INFO] [stdout] --> src/shell/mod.rs:21:25 [INFO] [stdout] | [INFO] [stdout] 21 | wlr_layer::{LayerShellRequest, LayerSurfaceAttributes}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 27 | Serial, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rc::Rc` [INFO] [stdout] --> src/shell/output.rs:1:26 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cell::RefCell, rc::Rc}; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `SubsurfaceCachedState`, `TraversalAction`, `wayland_protocols::xdg_shell::server::xdg_toplevel`, and `with_surface_tree_downward` [INFO] [stdout] --> src/shell/output.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | wayland_protocols::xdg_shell::server::xdg_toplevel, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 16 | compositor::{with_surface_tree_downward, SubsurfaceCachedState, TraversalAction}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/window.rs:22:7 [INFO] [stdout] | [INFO] [stdout] 22 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/window.rs:28:11 [INFO] [stdout] | [INFO] [stdout] 28 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/window.rs:36:19 [INFO] [stdout] | [INFO] [stdout] 36 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/window.rs:44:19 [INFO] [stdout] | [INFO] [stdout] 44 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/mod.rs:371:11 [INFO] [stdout] | [INFO] [stdout] 371 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `cell::RefCell` and `rc::Rc` [INFO] [stdout] --> src/main.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cell::RefCell, fs::OpenOptions, path::PathBuf, rc::Rc}; [INFO] [stdout] | ^^^^^^^^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `backend::input::KeyState` [INFO] [stdout] --> src/handler/keyboard.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | backend::input::KeyState, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `LayerShellRequest`, `LayerSurfaceAttributes`, and `Serial` [INFO] [stdout] --> src/shell/mod.rs:21:25 [INFO] [stdout] | [INFO] [stdout] 21 | wlr_layer::{LayerShellRequest, LayerSurfaceAttributes}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 27 | Serial, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rc::Rc` [INFO] [stdout] --> src/shell/output.rs:1:26 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cell::RefCell, rc::Rc}; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `SubsurfaceCachedState`, `TraversalAction`, `wayland_protocols::xdg_shell::server::xdg_toplevel`, and `with_surface_tree_downward` [INFO] [stdout] --> src/shell/output.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | wayland_protocols::xdg_shell::server::xdg_toplevel, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 16 | compositor::{with_surface_tree_downward, SubsurfaceCachedState, TraversalAction}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/window.rs:22:7 [INFO] [stdout] | [INFO] [stdout] 22 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/window.rs:28:11 [INFO] [stdout] | [INFO] [stdout] 28 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/window.rs:36:19 [INFO] [stdout] | [INFO] [stdout] 36 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/window.rs:44:19 [INFO] [stdout] | [INFO] [stdout] 44 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `xwayland` [INFO] [stdout] --> src/shell/mod.rs:371:11 [INFO] [stdout] | [INFO] [stdout] 371 | #[cfg(feature = "xwayland")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `xwayland` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-635b34f364709305/out/wl_drm.rs:1:19842 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:20183 [INFO] [stdout] | [INFO] [stdout] 1 | ...interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:20693 [INFO] [stdout] | [INFO] [stdout] 1 | ...interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:19842 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:21381 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as *... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:20183 [INFO] [stdout] | [INFO] [stdout] 1 | ...interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:21563 [INFO] [stdout] | [INFO] [stdout] 1 | ...onst c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_drm_requests_create_buffer_types) as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:20693 [INFO] [stdout] | [INFO] [stdout] 1 | ...interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:21782 [INFO] [stdout] | [INFO] [stdout] 1 | ... c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_drm_requests_create_planar_buffer_types) as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:21381 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as *... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22008 [INFO] [stdout] | [INFO] [stdout] 1 | ...t c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the 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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_drm_requests_create_prime_buffer_types) as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:21563 [INFO] [stdout] | [INFO] [stdout] 1 | ...onst c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_drm_requests_create_buffer_types) as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22341 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:21782 [INFO] [stdout] | [INFO] [stdout] 1 | ... c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_drm_requests_create_planar_buffer_types) as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22008 [INFO] [stdout] | [INFO] [stdout] 1 | ...t c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the 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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_drm_requests_create_prime_buffer_types) as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22511 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\0" as * const u8 as *... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22341 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22511 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\0" as * const u8 as *... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22687 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"capabilities\0" as * const u8 as * ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22687 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"capabilities\0" as * const u8 as * ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22863 [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:22863 [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:23133 [INFO] [stdout] | [INFO] [stdout] 1 | ... request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_events as * c... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { addr_of!(wl_drm_requests) as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:23133 [INFO] [stdout] | [INFO] [stdout] 1 | ... request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_events as * c... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { addr_of!(wl_drm_requests) as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:23204 [INFO] [stdout] | [INFO] [stdout] 1 | ..._ } , event_count : 4 , events : unsafe { & wl_drm_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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { addr_of!(wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:23204 [INFO] [stdout] | [INFO] [stdout] 1 | ..._ } , event_count : 4 , events : unsafe { & wl_drm_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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { addr_of!(wl_drm_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:17871 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:18218 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,]... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:17871 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:18620 [INFO] [stdout] | [INFO] [stdout] 1 | ...char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_display_requests_create_stream_types) as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:18218 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,]... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:18837 [INFO] [stdout] | [INFO] [stdout] 1 | ...char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_ev... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_display_requests_swap_interval_types) as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:18620 [INFO] [stdout] | [INFO] [stdout] 1 | ...char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_display_requests_create_stream_types) as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:19055 [INFO] [stdout] | [INFO] [stdout] 1 | ...nst wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:19407 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:18837 [INFO] [stdout] | [INFO] [stdout] 1 | ...char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_ev... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_display_requests_swap_interval_types) as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:19055 [INFO] [stdout] | [INFO] [stdout] 1 | ...nst wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:19593 [INFO] [stdout] | [INFO] [stdout] 1 | ...r , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_display_events_swapinterval_override_types) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:19407 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { addr_of!(types_null) as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:19593 [INFO] [stdout] | [INFO] [stdout] 1 | ...r , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_display_events_swapinterval_override_types) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:19936 [INFO] [stdout] | [INFO] [stdout] 1 | ...t_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { addr_of!(wl_eglstream_display_requests) as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:19936 [INFO] [stdout] | [INFO] [stdout] 1 | ...t_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { addr_of!(wl_eglstream_display_requests) as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:20021 [INFO] [stdout] | [INFO] [stdout] 1 | ...vent_count : 2 , events : unsafe { & wl_eglstream_display_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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { addr_of!(wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:20021 [INFO] [stdout] | [INFO] [stdout] 1 | ...vent_count : 2 , events : unsafe { & wl_eglstream_display_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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { addr_of!(wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:8867 [INFO] [stdout] | [INFO] [stdout] 1 | ...interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: ... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { addr_of!(super :: wl_surface :: wl_surface_interface) as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:8950 [INFO] [stdout] | [INFO] [stdout] 1 | ...t wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_control... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:9150 [INFO] [stdout] | [INFO] [stdout] 1 | ...interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: ... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { addr_of!(super :: wl_surface :: wl_surface_interface) as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:9233 [INFO] [stdout] | [INFO] [stdout] 1 | ...t wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,]... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:8867 [INFO] [stdout] | [INFO] [stdout] 1 | ...interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: ... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { addr_of!(super :: wl_surface :: wl_surface_interface) as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:8950 [INFO] [stdout] | [INFO] [stdout] 1 | ...t wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_control... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:9150 [INFO] [stdout] | [INFO] [stdout] 1 | ...interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: ... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { addr_of!(super :: wl_surface :: wl_surface_interface) as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:9233 [INFO] [stdout] | [INFO] [stdout] 1 | ...t wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,]... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { addr_of!(super :: wl_buffer :: wl_buffer_interface) as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:9646 [INFO] [stdout] | [INFO] [stdout] 1 | ...ypes : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_e... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_controller_requests_attach_eglstream_consumer_types) as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:9646 [INFO] [stdout] | [INFO] [stdout] 1 | ...ypes : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_e... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_controller_requests_attach_eglstream_consumer_types) as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:9900 [INFO] [stdout] | [INFO] [stdout] 1 | ... : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C represent... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:9900 [INFO] [stdout] | [INFO] [stdout] 1 | ... : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C represent... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { addr_of!(wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types) as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:10266 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_m... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { addr_of!(wl_eglstream_controller_requests) as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:10266 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_m... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { addr_of!(wl_eglstream_controller_requests) as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_drm.rs:1:18294 [INFO] [stdout] | [INFO] [stdout] 1 | ...e () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> (... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(wl_drm_interface) } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_drm.rs:1:18294 [INFO] [stdout] | [INFO] [stdout] 1 | ...e () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> (... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_drm { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { AuthenticateFail = 0 , InvalidFormat = 1 , InvalidName = 2 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: AuthenticateFail) , 1 => Some (Error :: InvalidFormat) , 2 => Some (Error :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Format { C8 = 538982467 , Rgb332 = 943867730 , Bgr233 = 944916290 , Xrgb4444 = 842093144 , Xbgr4444 = 842089048 , Rgbx4444 = 842094674 , Bgrx4444 = 842094658 , Argb4444 = 842093121 , Abgr4444 = 842089025 , Rgba4444 = 842088786 , Bgra4444 = 842088770 , Xrgb1555 = 892424792 , Xbgr1555 = 892420696 , Rgbx5551 = 892426322 , Bgrx5551 = 892426306 , Argb1555 = 892424769 , Abgr1555 = 892420673 , Rgba5551 = 892420434 , Bgra5551 = 892420418 , Rgb565 = 909199186 , Bgr565 = 909199170 , Rgb888 = 875710290 , Bgr888 = 875710274 , Xrgb8888 = 875713112 , Xbgr8888 = 875709016 , Rgbx8888 = 875714642 , Bgrx8888 = 875714626 , Argb8888 = 875713089 , Abgr8888 = 875708993 , Rgba8888 = 875708754 , Bgra8888 = 875708738 , Xrgb2101010 = 808669784 , Xbgr2101010 = 808665688 , Rgbx1010102 = 808671314 , Bgrx1010102 = 808671298 , Argb2101010 = 808669761 , Abgr2101010 = 808665665 , Rgba1010102 = 808665426 , Bgra1010102 = 808665410 , Yuyv = 1448695129 , Yvyu = 1431918169 , Uyvy = 1498831189 , Vyuy = 1498765654 , Ayuv = 1448433985 , Xyuv8888 = 1448434008 , Nv12 = 842094158 , Nv21 = 825382478 , Nv16 = 909203022 , Nv61 = 825644622 , Yuv410 = 961959257 , Yvu410 = 961893977 , Yuv411 = 825316697 , Yvu411 = 825316953 , Yuv420 = 842093913 , Yvu420 = 842094169 , Yuv422 = 909202777 , Yvu422 = 909203033 , Yuv444 = 875713881 , Yvu444 = 875714137 , Abgr16f = 1211384385 , Xbgr16f = 1211384408 , } impl Format { pub fn from_raw (n : u32) -> Option < Format > { match n { 538982467 => Some (Format :: C8) , 943867730 => Some (Format :: Rgb332) , 944916290 => Some (Format :: Bgr233) , 842093144 => Some (Format :: Xrgb4444) , 842089048 => Some (Format :: Xbgr4444) , 842094674 => Some (Format :: Rgbx4444) , 842094658 => Some (Format :: Bgrx4444) , 842093121 => Some (Format :: Argb4444) , 842089025 => Some (Format :: Abgr4444) , 842088786 => Some (Format :: Rgba4444) , 842088770 => Some (Format :: Bgra4444) , 892424792 => Some (Format :: Xrgb1555) , 892420696 => Some (Format :: Xbgr1555) , 892426322 => Some (Format :: Rgbx5551) , 892426306 => Some (Format :: Bgrx5551) , 892424769 => Some (Format :: Argb1555) , 892420673 => Some (Format :: Abgr1555) , 892420434 => Some (Format :: Rgba5551) , 892420418 => Some (Format :: Bgra5551) , 909199186 => Some (Format :: Rgb565) , 909199170 => Some (Format :: Bgr565) , 875710290 => Some (Format :: Rgb888) , 875710274 => Some (Format :: Bgr888) , 875713112 => Some (Format :: Xrgb8888) , 875709016 => Some (Format :: Xbgr8888) , 875714642 => Some (Format :: Rgbx8888) , 875714626 => Some (Format :: Bgrx8888) , 875713089 => Some (Format :: Argb8888) , 875708993 => Some (Format :: Abgr8888) , 875708754 => Some (Format :: Rgba8888) , 875708738 => Some (Format :: Bgra8888) , 808669784 => Some (Format :: Xrgb2101010) , 808665688 => Some (Format :: Xbgr2101010) , 808671314 => Some (Format :: Rgbx1010102) , 808671298 => Some (Format :: Bgrx1010102) , 808669761 => Some (Format :: Argb2101010) , 808665665 => Some (Format :: Abgr2101010) , 808665426 => Some (Format :: Rgba1010102) , 808665410 => Some (Format :: Bgra1010102) , 1448695129 => Some (Format :: Yuyv) , 1431918169 => Some (Format :: Yvyu) , 1498831189 => Some (Format :: Uyvy) , 1498765654 => Some (Format :: Vyuy) , 1448433985 => Some (Format :: Ayuv) , 1448434008 => Some (Format :: Xyuv8888) , 842094158 => Some (Format :: Nv12) , 825382478 => Some (Format :: Nv21) , 909203022 => Some (Format :: Nv16) , 825644622 => Some (Format :: Nv61) , 961959257 => Some (Format :: Yuv410) , 961893977 => Some (Format :: Yvu410) , 825316697 => Some (Format :: Yuv411) , 825316953 => Some (Format :: Yvu411) , 842093913 => Some (Format :: Yuv420) , 842094169 => Some (Format :: Yvu420) , 909202777 => Some (Format :: Yuv422) , 909203033 => Some (Format :: Yvu422) , 875713881 => Some (Format :: Yuv444) , 875714137 => Some (Format :: Yvu444) , 1211384385 => Some (Format :: Abgr16f) , 1211384408 => Some (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitmask\n\nBitmask of capabilities."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Capability { # [doc = "wl_drm prime available"] Prime = 1 , } impl Capability { pub fn from_raw (n : u32) -> Option < Capability > { match n { 1 => Some (Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , # [doc = "Only available since version 2 of the interface"] CreatePrimeBuffer { id : Main < super :: wl_buffer :: WlBuffer > , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "authenticate" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "create_planar_buffer" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "create_prime_buffer" , since : 2 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Uint , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } => 0 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 2 , Request :: CreatePrimeBuffer { .. } => 3 , } } fn since (& self) -> u32 { match * self { Request :: Authenticate { .. } => 1 , Request :: CreateBuffer { .. } => 1 , Request :: CreatePlanarBuffer { .. } => 1 , Request :: CreatePrimeBuffer { .. } => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , 3 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: Authenticate { id : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePlanarBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreatePrimeBuffer { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , name : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , offset0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride0 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride1 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , offset2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , stride2 : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Request :: Authenticate { id : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , stride : _args [4] . u , format : _args [5] . u , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePlanarBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . u , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 11) ; Ok (Request :: CreatePrimeBuffer { id : { let me = Resource :: < WlDrm > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , name : _args [1] . h , width : _args [2] . i , height : _args [3] . i , format : _args [4] . u , offset0 : _args [5] . i , stride0 : _args [6] . i , offset1 : _args [7] . i , stride1 : _args [8] . i , offset2 : _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "device" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "format" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "authenticated" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "capabilities" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , Event :: Format { .. } => 1 , Event :: Authenticated => 2 , Event :: Capabilities { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: Device { .. } => 1 , Event :: Format { .. } => 1 , Event :: Authenticated => 1 , Event :: Capabilities { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe { :: std :: ffi :: CString :: from_vec_unchecked (name . into ()) })) ,] , } , Event :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Device { name } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; let _arg_0 = :: std :: ffi :: CString :: new (name) . unwrap () ; _args_array [0] . s = _arg_0 . as_ptr () ; f (0 , & mut _args_array) } , Event :: Format { format } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; f (1 , & mut _args_array) } , Event :: Authenticated => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Event :: Capabilities { value } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = value ; f (3 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Resource < WlDrm >) ; impl AsRef < Resource < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlDrm >> for WlDrm { # [inline] fn from (value : Resource < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Resource < WlDrm > { # [inline] fn from (value : WlDrm) -> Self { value . 0 } } impl std :: fmt :: Debug for WlDrm { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlDrm { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_drm" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(wl_drm_interface) } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\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"capabilities\0" as * const u8 as * const c_char , signature : b"u\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 wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:6374 [INFO] [stdout] | [INFO] [stdout] 1 | ...) -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interfac... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(wl_eglstream_interface) } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:16326 [INFO] [stdout] | [INFO] [stdout] 1 | ... * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(wl_eglstream_display_interface) } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:6374 [INFO] [stdout] | [INFO] [stdout] 1 | ...) -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interfac... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(wl_eglstream_interface) } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream.rs:1:16326 [INFO] [stdout] | [INFO] [stdout] 1 | ... * const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\... [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 ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; pub mod wl_eglstream { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "Bad allocation error"] BadAlloc = 0 , # [doc = "Bad handle error"] BadHandle = 1 , # [doc = "Bad attributes error"] BadAttribs = 2 , # [doc = "Bad IP address error"] BadAddress = 3 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: BadAlloc) , 1 => Some (Error :: BadHandle) , 2 => Some (Error :: BadAttribs) , 3 => Some (Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n- fd: The given handle represents a file descriptor, and the\nEGLStream connection must be done as described in\nEGL_KHR_stream_cross_process_fd\n\n- inet: The EGLStream connection must be done using an inet address\nand port as described in EGL_NV_stream_socket. The given\nhandle can be ignored, but both inet address and port must\nbe given as attributes.\n\n- socket: The given handle represents a unix socket, and the EGLStream\nconnection must be done as described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum HandleType { # [doc = "File descriptor"] Fd = 0 , # [doc = "Inet connection"] Inet = 1 , # [doc = "Unix socket"] Socket = 2 , } impl HandleType { pub fn from_raw (n : u32) -> Option < HandleType > { match n { 0 => Some (HandleType :: Fd) , 1 => Some (HandleType :: Inet) , 2 => Some (HandleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attributes\n\n- inet_addr: The given attribute encodes an IPv4 address of a client\nsocket. Both IPv4 address and port must be set at the same\ntime.\n\n- inet_port: The given attribute encodes a port of a client socket.\nBoth IPv4 address and port must be set at the same time.\n\n- y_inverted: The given attribute encodes the default value for a\nstream's image inversion relative to wayland protocol\nconvention. Vulkan apps will be set to 'true', while\nOpenGL apps will be set to 'false'.\nNOTE: EGL_NV_stream_origin is the authorative source of\ntruth regarding a stream's frame orientation and should be\nqueried for an accurate value. The given attribute is a\n'best guess' fallback mechanism which should only be used\nwhen a query to EGL_NV_stream_origin fails."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Inet IPv4 address"] InetAddr = 0 , # [doc = "IP port"] InetPort = 1 , # [doc = "Image Y-inversion bit"] YInverted = 2 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: InetAddr) , 1 => Some (Attrib :: InetPort) , 2 => Some (Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstream (Resource < WlEglstream >) ; impl AsRef < Resource < WlEglstream >> for WlEglstream { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstream >> for WlEglstream { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstream (value) } } impl From < WlEglstream > for Resource < WlEglstream > { # [inline] fn from (value : WlEglstream) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstream { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstream { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & wl_eglstream_interface } } } impl WlEglstream { } # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_interface : wl_interface = wl_interface { name : b"wl_eglstream\0" as * const u8 as * const c_char , version : 1 , request_count : 0 , requests : NULLPTR as * const wl_message , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod wl_eglstream_display { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "wl_eglstream_display capability codes\n\nThis enum values should be used as bit masks.\n\n- stream_fd: The server supports EGLStream connections as described\nin EGL_KHR_stream_cross_process_fd\n\n- stream_inet: The server supports EGLStream inet connections as\ndescribed in EGL_NV_stream_socket.\n\n- stream_socket: The server supports EGLStream unix socket connections\nas described in EGL_NV_stream_socket."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } impl Cap { pub fn from_raw (n : u32) -> Option < Cap > { match n { 1 => Some (Cap :: StreamFd) , 2 => Some (Cap :: StreamInet) , 4 => Some (Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a wl_buffer from the given handle\n\nCreate a wl_buffer corresponding to given handle. The attributes list\nmay be used to define additional EGLStream connection data (e.g inet\naddress/port). The server can create its EGLStream handle using the\ninformation encoded in the wl_buffer."] CreateStream { id : Main < super :: wl_buffer :: WlBuffer > , width : i32 , height : i32 , handle : :: std :: os :: unix :: io :: RawFd , _type : i32 , attribs : Vec < u8 > , } , # [doc = "change the swap interval of an EGLStream consumer\n\nSet the swap interval for the consumer of the given EGLStream. The swap\ninterval is silently clamped to the valid range on the server side."] SwapInterval { stream : super :: wl_buffer :: WlBuffer , interval : i32 , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_stream" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Fd , super :: ArgumentType :: Int , super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "swap_interval" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } => 0 , Request :: SwapInterval { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: CreateStream { .. } => 1 , Request :: SwapInterval { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: wl_buffer :: WlBuffer > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Request :: CreateStream { id : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , width : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , height : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , handle : { if let Some (Argument :: Fd (val)) = args . next () { val } else { return Err (()) ; } } , _type : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: SwapInterval { stream : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , interval : { if let Some (Argument :: Int (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 6) ; Ok (Request :: CreateStream { id : { let me = Resource :: < WlEglstreamDisplay > :: from_c_ptr (obj as * mut _) ; me . make_child_for :: < super :: wl_buffer :: WlBuffer > (_args [0] . n) . unwrap () } , width : _args [1] . i , height : _args [2] . i , handle : _args [3] . h , _type : _args [4] . i , attribs : { let array = & * _args [5] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: SwapInterval { stream : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] Caps { caps : i32 , } , # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] SwapintervalOverride { swapinterval : i32 , stream : super :: wl_buffer :: WlBuffer , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "caps" , since : 1 , signature : & [super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "swapinterval_override" , since : 1 , signature : & [super :: ArgumentType :: Int , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Event :: SwapintervalOverride { .. } => 1 , } } fn since (& self) -> u32 { match * self { Event :: Caps { .. } => 1 , Event :: SwapintervalOverride { .. } => 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 ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event :: SwapintervalOverride { swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argument :: Object (stream . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Event :: Caps { caps } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = caps ; f (0 , & mut _args_array) } , Event :: SwapintervalOverride { swapinterval , stream } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . i = swapinterval ; _args_array [1] . o = stream . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamDisplay (Resource < WlEglstreamDisplay >) ; impl AsRef < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamDisplay >> for WlEglstreamDisplay { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamDisplay (value) } } impl From < WlEglstreamDisplay > for Resource < WlEglstreamDisplay > { # [inline] fn from (value : WlEglstreamDisplay) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamDisplay { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamDisplay { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_display" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(wl_eglstream_display_interface) } } } impl WlEglstreamDisplay { # [doc = "Server capabilities event\n\nThe capabilities event is sent out at wl_eglstream_display binding\ntime. It allows the server to advertise what features it supports so\nclients may know what is safe to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override event\n\nThe swapinterval_override event is sent out whenever a client requests\na swapinterval setting through swap_interval() and there is an override\nin place that will make such request to be ignored.\nThe swapinterval_override event will provide the override value so\nthat the client is made aware of it."] pub fn swapinterval_override (& self , swapinterval : i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_STREAM_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SWAP_INTERVAL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_SWAPINTERVAL_OVERRIDE_SINCE : u32 = 1u32 ; static mut wl_eglstream_display_requests_create_stream_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_eglstream_display_requests_swap_interval_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_requests : [wl_message ; 2] = [wl_message { name : b"create_stream\0" as * const u8 as * const c_char , signature : b"niihia\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval\0" as * const u8 as * const c_char , signature : b"oi\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_events_swapinterval_override_types : [* const wl_interface ; 2] = [NULLPTR as * const wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_display_events : [wl_message ; 2] = [wl_message { name : b"caps\0" as * const u8 as * const c_char , signature : b"i\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * const u8 as * const c_char , signature : b"io\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_display_interface : wl_interface = wl_interface { name : b"wl_eglstream_display\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstream_display_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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:8417 [INFO] [stdout] | [INFO] [stdout] 1 | ...* const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal objec... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(wl_eglstream_controller_interface) } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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/fireplace-635b34f364709305/out/wl_eglstream_controller.rs:1:8417 [INFO] [stdout] | [INFO] [stdout] 1 | ...* const wl_interface { unsafe { & wl_eglstream_controller_interface } } } impl WlEglstreamController { } # [doc = r" The minimal objec... [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] = [] ; pub mod wl_eglstream_controller { use std :: os :: raw :: c_char ; use super :: { Resource , AnonymousObject , Interface , MessageGroup , MessageDesc , Main , smallvec , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR } ; use super :: sys :: common :: { wl_argument , wl_interface , wl_array , wl_message } ; use super :: sys :: server :: * ; # [doc = "Stream present mode\n\n- dont_care: Using this enum will tell the server to make its own\ndecisions regarding present mode.\n\n- fifo: Tells the server to use a fifo present mode. The decision to\nuse fifo synchronous is left up to the server.\n\n- mailbox: Tells the server to use a mailbox present mode."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum PresentMode { # [doc = "Let the Server decide present mode"] DontCare = 0 , # [doc = "Use a fifo present mode"] Fifo = 1 , # [doc = "Use a mailbox mode"] Mailbox = 2 , } impl PresentMode { pub fn from_raw (n : u32) -> Option < PresentMode > { match n { 0 => Some (PresentMode :: DontCare) , 1 => Some (PresentMode :: Fifo) , 2 => Some (PresentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachment attributes\n\n- present_mode: Must be one of wl_eglstream_controller_present_mode. Tells the\nserver the desired present mode that should be used.\n\n- fifo_length: Only valid when the present_mode attrib is provided and its\nvalue is specified as fifo. Tells the server the desired fifo\nlength to be used when the desired present_mode is fifo."] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Attrib { # [doc = "Tells the server the desired present mode"] PresentMode = 0 , # [doc = "Tells the server the desired fifo length when the desired presenation_mode is fifo."] FifoLength = 1 , } impl Attrib { pub fn from_raw (n : u32) -> Option < Attrib > { match n { 0 => Some (Attrib :: PresentMode) , 1 => Some (Attrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create server stream and attach consumer\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it."] AttachEglstreamConsumer { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , } , # [doc = "Create server stream and attach consumer using attributes\n\nCreates the corresponding server side EGLStream from the given wl_buffer\nand attaches a consumer to it using the given attributes.\n\nOnly available since version 2 of the interface"] AttachEglstreamConsumerAttribs { wl_surface : super :: wl_surface :: WlSurface , wl_resource : super :: wl_buffer :: WlBuffer , attribs : Vec < u8 > , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "attach_eglstream_consumer" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "attach_eglstream_consumer_attribs" , since : 2 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Object , super :: ArgumentType :: Array ,] , destructor : false , } ,] ; type Map = super :: ResourceMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsumer { .. } => 0 , Request :: AttachEglstreamConsumerAttribs { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: AttachEglstreamConsumer { .. } => 1 , Request :: AttachEglstreamConsumerAttribs { .. } => 2 , } } 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 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumer { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , wl_resource : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , attribs : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::into_raw can not be used Server-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 2) ; Ok (Request :: AttachEglstreamConsumer { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 3) ; Ok (Request :: AttachEglstreamConsumerAttribs { wl_surface : Resource :: < super :: wl_surface :: WlSurface > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , wl_resource : Resource :: < super :: wl_buffer :: WlBuffer > :: from_c_ptr (_args [1] . o as * mut _ ,) . into () , attribs : { let array = & * _args [2] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Request::as_raw_c_in can not be used Server-side.") } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ResourceMap ; 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 , () > { panic ! ("Event::from_raw can not be used Server-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { panic ! ("Event::from_raw_c can not be used Server-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { } } } # [derive (Clone , Eq , PartialEq)] pub struct WlEglstreamController (Resource < WlEglstreamController >) ; impl AsRef < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn as_ref (& self) -> & Resource < Self > { & self . 0 } } impl From < Resource < WlEglstreamController >> for WlEglstreamController { # [inline] fn from (value : Resource < Self >) -> Self { WlEglstreamController (value) } } impl From < WlEglstreamController > for Resource < WlEglstreamController > { # [inline] fn from (value : WlEglstreamController) -> Self { value . 0 } } impl std :: fmt :: Debug for WlEglstreamController { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for WlEglstreamController { type Request = Request ; type Event = Event ; const NAME : & 'static str = "wl_eglstream_controller" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { addr_of!(wl_eglstream_controller_interface) } } } impl WlEglstreamController { } # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ATTACH_EGLSTREAM_CONSUMER_ATTRIBS_SINCE : u32 = 2u32 ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types : [* const wl_interface ; 3] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_eglstream_controller_requests : [wl_message ; 2] = [wl_message { name : b"attach_eglstream_consumer\0" as * const u8 as * const c_char , signature : b"oo\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach_eglstream_consumer_attribs\0" as * const u8 as * const c_char , signature : b"2ooa\0" as * const u8 as * const c_char , types : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_attribs_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_eglstream_controller_interface : wl_interface = wl_interface { name : b"wl_eglstream_controller\0" as * const u8 as * const c_char , version : 2 , request_count : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | ~~~~~~~~~ + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `layout::Layout` [INFO] [stdout] --> src/shell/mod.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | layout::Layout, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `layout::Layout` [INFO] [stdout] --> src/shell/mod.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | layout::Layout, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `session` [INFO] [stdout] --> src/backend/udev/mod.rs:392:40 [INFO] [stdout] | [INFO] [stdout] 392 | fn device_changed(&mut self, session: &mut S, device: dev_t) -> Result<()> [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_session` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `device` [INFO] [stdout] --> src/backend/udev/mod.rs:392:57 [INFO] [stdout] | [INFO] [stdout] 392 | fn device_changed(&mut self, session: &mut S, device: dev_t) -> Result<()> [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_device` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `session` [INFO] [stdout] --> src/backend/udev/mod.rs:400:40 [INFO] [stdout] | [INFO] [stdout] 400 | fn device_removed(&mut self, session: &mut S, device: dev_t) -> Result<()> [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_session` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `device` [INFO] [stdout] --> src/backend/udev/mod.rs:400:57 [INFO] [stdout] | [INFO] [stdout] 400 | fn device_removed(&mut self, session: &mut S, device: dev_t) -> Result<()> [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_device` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `session` [INFO] [stdout] --> src/backend/udev/mod.rs:392:40 [INFO] [stdout] | [INFO] [stdout] 392 | fn device_changed(&mut self, session: &mut S, device: dev_t) -> Result<()> [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_session` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `device` [INFO] [stdout] --> src/backend/udev/mod.rs:392:57 [INFO] [stdout] | [INFO] [stdout] 392 | fn device_changed(&mut self, session: &mut S, device: dev_t) -> Result<()> [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_device` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `session` [INFO] [stdout] --> src/backend/udev/mod.rs:400:40 [INFO] [stdout] | [INFO] [stdout] 400 | fn device_removed(&mut self, session: &mut S, device: dev_t) -> Result<()> [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_session` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `device` [INFO] [stdout] --> src/backend/udev/mod.rs:400:57 [INFO] [stdout] | [INFO] [stdout] 400 | fn device_removed(&mut self, session: &mut S, device: dev_t) -> Result<()> [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_device` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/layout/floating.rs:211:25 [INFO] [stdout] | [INFO] [stdout] 211 | let mut data = states [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/layout/floating.rs:211:25 [INFO] [stdout] | [INFO] [stdout] 211 | let mut data = states [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/layout/floating.rs:437:17 [INFO] [stdout] | [INFO] [stdout] 437 | let mut data = states [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/layout/floating.rs:423:13 [INFO] [stdout] | [INFO] [stdout] 423 | let mut initial_window_location = match window.borrow().location() { [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/layout/floating.rs:506:25 [INFO] [stdout] | [INFO] [stdout] 506 | let mut data = states [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/window.rs:156:13 [INFO] [stdout] | [INFO] [stdout] 156 | let mut window = Window { [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/layout/floating.rs:437:17 [INFO] [stdout] | [INFO] [stdout] 437 | let mut data = states [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/layout/floating.rs:423:13 [INFO] [stdout] | [INFO] [stdout] 423 | let mut initial_window_location = match window.borrow().location() { [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/layout/floating.rs:506:25 [INFO] [stdout] | [INFO] [stdout] 506 | let mut data = states [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/shell/window.rs:156:13 [INFO] [stdout] | [INFO] [stdout] 156 | let mut window = Window { [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `geometry` is never read [INFO] [stdout] --> src/shell/mod.rs:279:9 [INFO] [stdout] | [INFO] [stdout] 276 | pub struct SurfaceData { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 279 | pub geometry: Option>, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `location` is never used [INFO] [stdout] --> src/shell/layout/floating.rs:311:12 [INFO] [stdout] | [INFO] [stdout] 301 | impl Floating { [INFO] [stdout] | ------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 311 | pub fn location(&self, surface: &Kind) -> Option> { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `surfaces` is never read [INFO] [stdout] --> src/shell/output.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 29 | pub struct Output { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 33 | surfaces: Vec, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Output` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `size` is never read [INFO] [stdout] --> src/shell/window.rs:133:5 [INFO] [stdout] | [INFO] [stdout] 131 | pub struct Window { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] 132 | location: Option>, [INFO] [stdout] 133 | size: Size, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Window` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [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/main.rs:73:23 [INFO] [stdout] | [INFO] [stdout] 71 | let display = state.display.clone(); [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 72 | let mut display = display.borrow_mut(); [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 73 | match display.dispatch(std::time::Duration::from_millis(0), state) { [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/backend/render.rs:187:122 [INFO] [stdout] | [INFO] [stdout] 181 | ... let maybe_dma = handle_eglstream_events(&texture.buffer); [INFO] [stdout] | --------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 187 | ... let dma = texture.buffer.as_ref().user_data().get::().cloned().unwrap_or_else(|| maybe_dma.unwrap().1); [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/backend/udev/mod.rs:99:67 [INFO] [stdout] | [INFO] [stdout] 73 | let (mut session, notifier) = AutoSession::new(None).context("Failed to create Session")?; [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 74 | let signaler = notifier.signaler(); [INFO] [stdout] | -------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 96 | let handle = event_loop.handle(); [INFO] [stdout] | ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 99 | .insert_source(udev_backend, move |event, _, state| match match event { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 100 | | UdevEvent::Added { device_id, path } => state.device_added(handle.clone(), &mut session, signaler.clone(), device_id, path), [INFO] [stdout] 101 | | UdevEvent::Changed { device_id } => state.device_changed(&mut session, device_id), [INFO] [stdout] 102 | | UdevEvent::Removed { device_id } => state.device_removed(&mut session, device_id), [INFO] [stdout] 103 | | } { [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/backend/udev/mod.rs:456:73 [INFO] [stdout] | [INFO] [stdout] 456 | seat.user_data().get::().map(|name| &*name.0.borrow() == output_name).unwrap_or(false) [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/backend/udev/cursor.rs:92:39 [INFO] [stdout] | [INFO] [stdout] 89 | let mut cursor_file = std::fs::File::open(&icon_path)?; [INFO] [stdout] | ----------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 92 | parse_xcursor(&cursor_data).ok_or(Error::Parse) [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [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/backend/udev/surface/mod.rs:33:12 [INFO] [stdout] | [INFO] [stdout] 30 | pub fn new_gbm(surf: DrmSurface, fd: SessionFd, ctx: &EGLContext) -> anyhow::Result { [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 31 | let gbm_device = GbmDevice::new(fd)?; [INFO] [stdout] | ---------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 32 | let gbm_surface = GbmBufferedSurface::new(surf, gbm_device, ctx.dmabuf_render_formats().clone(), None)?; [INFO] [stdout] | ----------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 33 | Ok(RenderSurface::Gbm(gbm_surface)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [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/backend/udev/surface/mod.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 36 | pub fn new_eglstream(surf: DrmSurface, disp: &EGLDisplay, ctx: &EGLContext) -> anyhow::Result { [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 37 | let stream_surface = EglStreamSurface::new(surf, slog_scope::logger()); [INFO] [stdout] | -------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 38 | let crtc = stream_surface.crtc(); [INFO] [stdout] 39 | let egl_surface = Rc::new(EGLSurface::new( [INFO] [stdout] | ----------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 46 | Ok(RenderSurface::Egl(egl_surface, crtc)) [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/backend/winit.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 51 | let renderer = renderer.clone(); [INFO] [stdout] | -------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 55 | move |buffer, _| renderer.borrow_mut().renderer().import_dmabuf(buffer).is_ok(), [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] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/backend/winit.rs:75:25 [INFO] [stdout] | [INFO] [stdout] 75 | .add_output(name.clone(), props, mode); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [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/handler/mod.rs:60:48 [INFO] [stdout] | [INFO] [stdout] 60 | userdata.insert_if_missing(|| RefCell::new(CursorImageStatus::Hidden)); [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/handler/keyboard.rs:9:39 [INFO] [stdout] | [INFO] [stdout] 9 | #[derive(Debug, Clone, PartialEq, Eq, Deserialize)] [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] = note: this error originates in the macro `try` (in Nightly builds, run with -Z macro-backtrace for more info) [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/handler/keyboard.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 81 | fn deserialize_KeyModifiers<'de, D>(deserializer: D) -> Result [INFO] [stdout] | --------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 85 | KeyModifiersDef::deserialize(deserializer).map(Into::into) [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] warning: field `geometry` is never read [INFO] [stdout] --> src/shell/mod.rs:279:9 [INFO] [stdout] | [INFO] [stdout] 276 | pub struct SurfaceData { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 279 | pub geometry: Option>, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `location` is never used [INFO] [stdout] --> src/shell/layout/floating.rs:311:12 [INFO] [stdout] | [INFO] [stdout] 301 | impl Floating { [INFO] [stdout] | ------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 311 | pub fn location(&self, surface: &Kind) -> Option> { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `surfaces` is never read [INFO] [stdout] --> src/shell/output.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 29 | pub struct Output { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 33 | surfaces: Vec, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Output` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [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/logger.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | #[derive(Deserialize, Debug)] [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] = note: this error originates in the macro `try` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `size` is never read [INFO] [stdout] --> src/shell/window.rs:133:5 [INFO] [stdout] | [INFO] [stdout] 131 | pub struct Window { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] 132 | location: Option>, [INFO] [stdout] 133 | size: Size, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Window` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [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/logger.rs:33:10 [INFO] [stdout] | [INFO] [stdout] 33 | #[derive(Deserialize, Debug)] [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] = note: this error originates in the macro `try` (in Nightly builds, run with -Z macro-backtrace for more info) [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/shell/mod.rs:383:56 [INFO] [stdout] | [INFO] [stdout] 383 | .insert_if_missing(|| RefCell::new(SurfaceData::default())); [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/main.rs:73:23 [INFO] [stdout] | [INFO] [stdout] 71 | let display = state.display.clone(); [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 72 | let mut display = display.borrow_mut(); [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 73 | match display.dispatch(std::time::Duration::from_millis(0), state) { [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/backend/render.rs:187:122 [INFO] [stdout] | [INFO] [stdout] 181 | ... let maybe_dma = handle_eglstream_events(&texture.buffer); [INFO] [stdout] | --------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 187 | ... let dma = texture.buffer.as_ref().user_data().get::().cloned().unwrap_or_else(|| maybe_dma.unwrap().1); [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/backend/udev/mod.rs:99:67 [INFO] [stdout] | [INFO] [stdout] 73 | let (mut session, notifier) = AutoSession::new(None).context("Failed to create Session")?; [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 74 | let signaler = notifier.signaler(); [INFO] [stdout] | -------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 96 | let handle = event_loop.handle(); [INFO] [stdout] | ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 99 | .insert_source(udev_backend, move |event, _, state| match match event { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 100 | | UdevEvent::Added { device_id, path } => state.device_added(handle.clone(), &mut session, signaler.clone(), device_id, path), [INFO] [stdout] 101 | | UdevEvent::Changed { device_id } => state.device_changed(&mut session, device_id), [INFO] [stdout] 102 | | UdevEvent::Removed { device_id } => state.device_removed(&mut session, device_id), [INFO] [stdout] 103 | | } { [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/backend/udev/mod.rs:456:73 [INFO] [stdout] | [INFO] [stdout] 456 | seat.user_data().get::().map(|name| &*name.0.borrow() == output_name).unwrap_or(false) [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/backend/udev/cursor.rs:92:39 [INFO] [stdout] | [INFO] [stdout] 89 | let mut cursor_file = std::fs::File::open(&icon_path)?; [INFO] [stdout] | ----------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 92 | parse_xcursor(&cursor_data).ok_or(Error::Parse) [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [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] warning: unused `Result` that must be used [INFO] [stdout] --> src/shell/mod.rs:434:13 [INFO] [stdout] | [INFO] [stdout] 434 | popup.send_configure(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] = note: `#[warn(unused_must_use)]` on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 434 | let _ = popup.send_configure(); [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/shell/mod.rs:463:5 [INFO] [stdout] | [INFO] [stdout] 462 | pub fn child_popups<'a>(popups: impl DoubleEndedIterator, base: &'a wl_surface::WlSurface) -> impl Iterator [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/shell/mod.rs:465:26 [INFO] [stdout] | [INFO] [stdout] 465 | .filter(move |w| w.parent().as_ref() == Some(base)) [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/shell/layout/floating.rs:306:22 [INFO] [stdout] | [INFO] [stdout] 302 | pub fn new>>(size: S) -> Floating { [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 306 | windows: Vec::new(), [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/shell/layout/floating.rs:314:24 [INFO] [stdout] | [INFO] [stdout] 314 | .find(|w| &w.borrow().toplevel == surface) [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/shell/layout/floating.rs:315:27 [INFO] [stdout] | [INFO] [stdout] 315 | .and_then(|w| w.borrow().location()) [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/shell/layout/floating.rs:321:24 [INFO] [stdout] | [INFO] [stdout] 321 | .find(|w| &w.borrow().toplevel == surface) [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/backend/udev/surface/mod.rs:33:12 [INFO] [stdout] | [INFO] [stdout] 30 | pub fn new_gbm(surf: DrmSurface, fd: SessionFd, ctx: &EGLContext) -> anyhow::Result { [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 31 | let gbm_device = GbmDevice::new(fd)?; [INFO] [stdout] | ---------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 32 | let gbm_surface = GbmBufferedSurface::new(surf, gbm_device, ctx.dmabuf_render_formats().clone(), None)?; [INFO] [stdout] | ----------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 33 | Ok(RenderSurface::Gbm(gbm_surface)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] | these values have significant drop implementation and will observe changes in drop order under Edition 2024 [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/shell/layout/floating.rs:348:33 [INFO] [stdout] | [INFO] [stdout] 348 | self.windows.retain(|x| x.borrow().toplevel != surface); [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/shell/layout/floating.rs:670:46 [INFO] [stdout] | [INFO] [stdout] 670 | Box::new(self.windows.iter().map(|w| w.borrow().toplevel.clone())) [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/shell/layout/floating.rs:679:34 [INFO] [stdout] | [INFO] [stdout] 679 | .map(|location| (window.toplevel.clone(), location, window.bbox())) [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/backend/udev/surface/mod.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 36 | pub fn new_eglstream(surf: DrmSurface, disp: &EGLDisplay, ctx: &EGLContext) -> anyhow::Result { [INFO] [stdout] | --------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 37 | let stream_surface = EglStreamSurface::new(surf, slog_scope::logger()); [INFO] [stdout] | -------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 38 | let crtc = stream_surface.crtc(); [INFO] [stdout] 39 | let egl_surface = Rc::new(EGLSurface::new( [INFO] [stdout] | ----------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 46 | Ok(RenderSurface::Egl(egl_surface, crtc)) [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/shell/layout/floating.rs:688:28 [INFO] [stdout] | [INFO] [stdout] 688 | .find(|(_, w)| w.borrow().contains_surface(surface)) [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/backend/winit.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 51 | let renderer = renderer.clone(); [INFO] [stdout] | -------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 55 | move |buffer, _| renderer.borrow_mut().renderer().import_dmabuf(buffer).is_ok(), [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/shell/layout/floating.rs:705:22 [INFO] [stdout] | [INFO] [stdout] 705 | .map(|w| w.borrow().toplevel.clone()) [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/shell/layout/floating.rs:713:42 [INFO] [stdout] | [INFO] [stdout] 713 | self.windows.iter().find_map(|w| w.borrow().matching(point)) [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] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/backend/winit.rs:75:25 [INFO] [stdout] | [INFO] [stdout] 75 | .add_output(name.clone(), props, mode); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [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/shell/output.rs:90:23 [INFO] [stdout] | [INFO] [stdout] 54 | name: N, [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 64 | let (output, global) = output::Output::new(display, name.as_ref().into(), physical, None); [INFO] [stdout] | ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 90 | surfaces: Vec::new(), [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/handler/mod.rs:60:48 [INFO] [stdout] | [INFO] [stdout] 60 | userdata.insert_if_missing(|| RefCell::new(CursorImageStatus::Hidden)); [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/shell/output.rs:91:29 [INFO] [stdout] | [INFO] [stdout] 54 | name: N, [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 64 | let (output, global) = output::Output::new(display, name.as_ref().into(), physical, None); [INFO] [stdout] | ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 91 | layer_surfaces: Default::default(), [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/handler/keyboard.rs:9:39 [INFO] [stdout] | [INFO] [stdout] 9 | #[derive(Debug, Clone, PartialEq, Eq, Deserialize)] [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] = note: this error originates in the macro `try` (in Nightly builds, run with -Z macro-backtrace for more info) [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/shell/output.rs:95:23 [INFO] [stdout] | [INFO] [stdout] 54 | name: N, [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 64 | let (output, global) = output::Output::new(display, name.as_ref().into(), physical, None); [INFO] [stdout] | ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 95 | userdata: Default::default(), [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/handler/keyboard.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 81 | fn deserialize_KeyModifiers<'de, D>(deserializer: D) -> Result [INFO] [stdout] | --------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 85 | KeyModifiersDef::deserialize(deserializer).map(Into::into) [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/logger.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | #[derive(Deserialize, Debug)] [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] = note: this error originates in the macro `try` (in Nightly builds, run with -Z macro-backtrace for more info) [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/logger.rs:33:10 [INFO] [stdout] | [INFO] [stdout] 33 | #[derive(Deserialize, Debug)] [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] = note: this error originates in the macro `try` (in Nightly builds, run with -Z macro-backtrace for more info) [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/shell/mod.rs:383:56 [INFO] [stdout] | [INFO] [stdout] 383 | .insert_if_missing(|| RefCell::new(SurfaceData::default())); [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] warning: unused `Result` that must be used [INFO] [stdout] --> src/shell/mod.rs:434:13 [INFO] [stdout] | [INFO] [stdout] 434 | popup.send_configure(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] = note: `#[warn(unused_must_use)]` on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 434 | let _ = popup.send_configure(); [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/shell/mod.rs:463:5 [INFO] [stdout] | [INFO] [stdout] 462 | pub fn child_popups<'a>(popups: impl DoubleEndedIterator, base: &'a wl_surface::WlSurface) -> impl Iterator [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/shell/mod.rs:465:26 [INFO] [stdout] | [INFO] [stdout] 465 | .filter(move |w| w.parent().as_ref() == Some(base)) [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/shell/layout/floating.rs:306:22 [INFO] [stdout] | [INFO] [stdout] 302 | pub fn new>>(size: S) -> Floating { [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 306 | windows: Vec::new(), [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/shell/layout/floating.rs:314:24 [INFO] [stdout] | [INFO] [stdout] 314 | .find(|w| &w.borrow().toplevel == surface) [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/shell/layout/floating.rs:315:27 [INFO] [stdout] | [INFO] [stdout] 315 | .and_then(|w| w.borrow().location()) [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/shell/layout/floating.rs:321:24 [INFO] [stdout] | [INFO] [stdout] 321 | .find(|w| &w.borrow().toplevel == surface) [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/shell/layout/floating.rs:348:33 [INFO] [stdout] | [INFO] [stdout] 348 | self.windows.retain(|x| x.borrow().toplevel != surface); [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/shell/layout/floating.rs:670:46 [INFO] [stdout] | [INFO] [stdout] 670 | Box::new(self.windows.iter().map(|w| w.borrow().toplevel.clone())) [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/shell/layout/floating.rs:679:34 [INFO] [stdout] | [INFO] [stdout] 679 | .map(|location| (window.toplevel.clone(), location, window.bbox())) [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/shell/layout/floating.rs:688:28 [INFO] [stdout] | [INFO] [stdout] 688 | .find(|(_, w)| w.borrow().contains_surface(surface)) [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/shell/layout/floating.rs:705:22 [INFO] [stdout] | [INFO] [stdout] 705 | .map(|w| w.borrow().toplevel.clone()) [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/shell/layout/floating.rs:713:42 [INFO] [stdout] | [INFO] [stdout] 713 | self.windows.iter().find_map(|w| w.borrow().matching(point)) [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/shell/output.rs:90:23 [INFO] [stdout] | [INFO] [stdout] 54 | name: N, [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 64 | let (output, global) = output::Output::new(display, name.as_ref().into(), physical, None); [INFO] [stdout] | ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 90 | surfaces: Vec::new(), [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/shell/output.rs:91:29 [INFO] [stdout] | [INFO] [stdout] 54 | name: N, [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 64 | let (output, global) = output::Output::new(display, name.as_ref().into(), physical, None); [INFO] [stdout] | ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 91 | layer_surfaces: Default::default(), [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/shell/output.rs:95:23 [INFO] [stdout] | [INFO] [stdout] 54 | name: N, [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 64 | let (output, global) = output::Output::new(display, name.as_ref().into(), physical, None); [INFO] [stdout] | ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 95 | userdata: Default::default(), [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/shell/window.rs:227:29 [INFO] [stdout] | [INFO] [stdout] 227 | |_, _, _| !*found.borrow(), [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/shell/window.rs:246:59 [INFO] [stdout] | [INFO] [stdout] 246 | if let Some(size) = data.and_then(|d| d.borrow().size()) { [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/shell/workspace.rs:40:21 [INFO] [stdout] | [INFO] [stdout] 37 | pub fn new(display: Rc>) -> Workspaces { [INFO] [stdout] | ----------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 40 | spaces: LinkedHashMap::new(), [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/shell/workspace.rs:41:22 [INFO] [stdout] | [INFO] [stdout] 37 | pub fn new(display: Rc>) -> Workspaces { [INFO] [stdout] | ----------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 41 | outputs: Vec::new(), [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/shell/window.rs:227:29 [INFO] [stdout] | [INFO] [stdout] 227 | |_, _, _| !*found.borrow(), [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/shell/window.rs:246:59 [INFO] [stdout] | [INFO] [stdout] 246 | if let Some(size) = data.and_then(|d| d.borrow().size()) { [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/shell/workspace.rs:40:21 [INFO] [stdout] | [INFO] [stdout] 37 | pub fn new(display: Rc>) -> Workspaces { [INFO] [stdout] | ----------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 40 | spaces: LinkedHashMap::new(), [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/state.rs:104:19 [INFO] [stdout] | [INFO] [stdout] 77 | pub fn new(config: Config, display: Display, socket_name: OsString) -> Self { [INFO] [stdout] | ---------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 78 | let display = Rc::new(RefCell::new(display)); [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 81 | let shell = crate::shell::init_shell(display.clone()); [INFO] [stdout] | ----- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 82 | init_xdg_output_manager(&mut display.borrow_mut(), None); [INFO] [stdout] 83 | let initial_seat = crate::handler::add_seat(&mut *display.borrow_mut(), "seat-1".into()); [INFO] [stdout] | ------------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 104 | udev: HashMap::new(), [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/shell/workspace.rs:41:22 [INFO] [stdout] | [INFO] [stdout] 37 | pub fn new(display: Rc>) -> Workspaces { [INFO] [stdout] | ----------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 41 | outputs: Vec::new(), [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/wayland/drm.rs:88:63 [INFO] [stdout] | [INFO] [stdout] 86 | let mut dma = Dmabuf::builder((width, height), format, DmabufFlags::empty()); [INFO] [stdout] | --- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 87 | dma.add_plane(name, 0, offset0 as u32, stride0 as u32, Modifier::Invalid); [INFO] [stdout] 88 | id.as_ref().user_data().set_threadsafe(|| dma.build().unwrap()); [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/state.rs:104:19 [INFO] [stdout] | [INFO] [stdout] 77 | pub fn new(config: Config, display: Display, socket_name: OsString) -> Self { [INFO] [stdout] | ---------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 78 | let display = Rc::new(RefCell::new(display)); [INFO] [stdout] | ------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 81 | let shell = crate::shell::init_shell(display.clone()); [INFO] [stdout] | ----- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 82 | init_xdg_output_manager(&mut display.borrow_mut(), None); [INFO] [stdout] 83 | let initial_seat = crate::handler::add_seat(&mut *display.borrow_mut(), "seat-1".into()); [INFO] [stdout] | ------------ these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 104 | udev: HashMap::new(), [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/wayland/eglstream.rs:118:46 [INFO] [stdout] | [INFO] [stdout] 98 | client_filter: F, [INFO] [stdout] | ---------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 114 | let display_handle_display = egl_display.get_display_handle(); [INFO] [stdout] | ---------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 115 | let display_handle_controller = display_handle_display.clone(); [INFO] [stdout] | ------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 118 | display.create_global_with_filter(1, Filter::new(move |(eglstream_display, _version): (Main [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/wayland/eglstream.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 98 | client_filter: F, [INFO] [stdout] | ---------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 114 | let display_handle_display = egl_display.get_display_handle(); [INFO] [stdout] | ---------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 115 | let display_handle_controller = display_handle_display.clone(); [INFO] [stdout] | ------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 154 | }), client_filter.clone()), [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/wayland/drm.rs:88:63 [INFO] [stdout] | [INFO] [stdout] 86 | let mut dma = Dmabuf::builder((width, height), format, DmabufFlags::empty()); [INFO] [stdout] | --- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 87 | dma.add_plane(name, 0, offset0 as u32, stride0 as u32, Modifier::Invalid); [INFO] [stdout] 88 | id.as_ref().user_data().set_threadsafe(|| dma.build().unwrap()); [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/wayland/eglstream.rs:155:46 [INFO] [stdout] | [INFO] [stdout] 98 | client_filter: F, [INFO] [stdout] | ---------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 114 | let display_handle_display = egl_display.get_display_handle(); [INFO] [stdout] | ---------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 115 | let display_handle_controller = display_handle_display.clone(); [INFO] [stdout] | ------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 155 | display.create_global_with_filter(1, Filter::new(move |(eglstream_controller, _): (Main [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/wayland/eglstream.rs:118:46 [INFO] [stdout] | [INFO] [stdout] 98 | client_filter: F, [INFO] [stdout] | ---------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 114 | let display_handle_display = egl_display.get_display_handle(); [INFO] [stdout] | ---------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 115 | let display_handle_controller = display_handle_display.clone(); [INFO] [stdout] | ------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 118 | display.create_global_with_filter(1, Filter::new(move |(eglstream_display, _version): (Main [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/wayland/eglstream.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 98 | client_filter: F, [INFO] [stdout] | ---------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 114 | let display_handle_display = egl_display.get_display_handle(); [INFO] [stdout] | ---------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 115 | let display_handle_controller = display_handle_display.clone(); [INFO] [stdout] | ------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 154 | }), client_filter.clone()), [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/wayland/eglstream.rs:135:38 [INFO] [stdout] | [INFO] [stdout] 135 | ... display: Arc::downgrade(&display_handle), [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/wayland/eglstream.rs:139:38 [INFO] [stdout] | [INFO] [stdout] 139 | ... buffers: RefCell::new(Vec::with_capacity(4)), [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/wayland/eglstream.rs:155:46 [INFO] [stdout] | [INFO] [stdout] 98 | client_filter: F, [INFO] [stdout] | ---------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 114 | let display_handle_display = egl_display.get_display_handle(); [INFO] [stdout] | ---------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 115 | let display_handle_controller = display_handle_display.clone(); [INFO] [stdout] | ------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 155 | display.create_global_with_filter(1, Filter::new(move |(eglstream_controller, _): (Main [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/wayland/eglstream.rs:140:45 [INFO] [stdout] | [INFO] [stdout] 140 | ... current_buffer: RefCell::new(None), [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/wayland/eglstream.rs:135:38 [INFO] [stdout] | [INFO] [stdout] 135 | ... display: Arc::downgrade(&display_handle), [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/wayland/eglstream.rs:157:47 [INFO] [stdout] | [INFO] [stdout] 115 | let display_handle_controller = display_handle_display.clone(); [INFO] [stdout] | ------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 155 | display.create_global_with_filter(1, Filter::new(move |(eglstream_controller, _): (Main, u32), _... [INFO] [stdout] | -------------------------------------------------------------------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 156 | let display_handle = display_handle_controller.clone(); [INFO] [stdout] | -------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 157 | eglstream_controller.quick_assign(move |_, req, _| { [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 158 | | fn attach_egl_stream_consumer( [INFO] [stdout] 159 | | display: *const nix::libc::c_void, [INFO] [stdout] 160 | | surface: WlSurface, [INFO] [stdout] ... | [INFO] [stdout] 202 | | } [INFO] [stdout] 203 | | }) [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/wayland/eglstream.rs:139:38 [INFO] [stdout] | [INFO] [stdout] 139 | ... buffers: RefCell::new(Vec::with_capacity(4)), [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/wayland/eglstream.rs:140:45 [INFO] [stdout] | [INFO] [stdout] 140 | ... current_buffer: RefCell::new(None), [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/wayland/eglstream.rs:157:47 [INFO] [stdout] | [INFO] [stdout] 115 | let display_handle_controller = display_handle_display.clone(); [INFO] [stdout] | ------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] ... [INFO] [stdout] 155 | display.create_global_with_filter(1, Filter::new(move |(eglstream_controller, _): (Main, u32), _... [INFO] [stdout] | -------------------------------------------------------------------------------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 156 | let display_handle = display_handle_controller.clone(); [INFO] [stdout] | -------------- these values have significant drop implementation and will observe changes in drop order under Edition 2024 [INFO] [stdout] 157 | eglstream_controller.quick_assign(move |_, req, _| { [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 158 | | fn attach_egl_stream_consumer( [INFO] [stdout] 159 | | display: *const nix::libc::c_void, [INFO] [stdout] 160 | | surface: WlSurface, [INFO] [stdout] ... | [INFO] [stdout] 202 | | } [INFO] [stdout] 203 | | }) [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 42 previous errors; 59 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to 42 previous errors; 59 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `fireplace` (bin "fireplace" test) due to 43 previous errors; 59 warnings emitted [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] error: could not compile `fireplace` (bin "fireplace") due to 43 previous errors; 59 warnings emitted [INFO] running `Command { std: "docker" "inspect" "7c07817ab53f27af5eb80e5a73b1f56d4e3d1895a0691332fb63c73a0d9827c4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7c07817ab53f27af5eb80e5a73b1f56d4e3d1895a0691332fb63c73a0d9827c4", kill_on_drop: false }` [INFO] [stdout] 7c07817ab53f27af5eb80e5a73b1f56d4e3d1895a0691332fb63c73a0d9827c4