[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] linting Drakulix/fireplace against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDrakulix%2Ffireplace" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [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-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Drakulix/fireplace on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [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" "+nightly" "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] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Updating git repository `https://github.com/Smithay/smithay` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded version_check v0.9.3 [INFO] [stderr] Downloaded redox_users v0.3.5 [INFO] [stderr] Downloaded xdg v2.3.0 [INFO] [stderr] Downloaded rust-argon2 v0.8.3 [INFO] [stderr] Downloaded wayland-sys v0.29.0 [INFO] [stderr] Downloaded num_enum_derive v0.5.4 [INFO] [stderr] Downloaded memoffset v0.6.4 [INFO] [stderr] Downloaded quote v1.0.10 [INFO] [stderr] Downloaded arc-swap v1.4.0 [INFO] [stderr] Downloaded linked-hash-map v0.5.4 [INFO] [stderr] Downloaded gbm-sys v0.2.0 [INFO] [stderr] Downloaded serde v1.0.130 [INFO] [stderr] Downloaded anyhow v1.0.44 [INFO] [stderr] Downloaded crossbeam-channel v0.5.1 [INFO] [stderr] Downloaded calloop v0.9.1 [INFO] [stderr] Downloaded dbus v0.9.5 [INFO] [stderr] Downloaded time v0.1.43 [INFO] [stderr] Downloaded gbm v0.7.0 [INFO] [stderr] Downloaded winit v0.25.0 [INFO] [stderr] Downloaded input-sys v1.16.0 [INFO] [stderr] Downloaded indexmap v1.7.0 [INFO] [stderr] Downloaded scan_fmt v0.2.6 [INFO] [stderr] Downloaded edid-rs v0.1.0 [INFO] [stderr] Downloaded wayland-client v0.29.0 [INFO] [stderr] Downloaded libdbus-sys v0.2.2 [INFO] [stderr] Downloaded udev v0.6.2 [INFO] [stderr] Downloaded slog-async v2.7.0 [INFO] [stderr] Downloaded slog-term v2.8.0 [INFO] [stderr] Downloaded nix v0.22.2 [INFO] [stderr] Downloaded miow v0.3.7 [INFO] [stderr] Downloaded ntapi v0.3.6 [INFO] [stderr] Downloaded ndk-sys v0.2.1 [INFO] [stderr] Downloaded nix v0.20.2 [INFO] [stderr] Downloaded syn v1.0.80 [INFO] [stderr] Downloaded drm v0.5.0 [INFO] [stderr] Downloaded slog v2.7.0 [INFO] [stderr] Downloaded slog-scope v4.4.0 [INFO] [stderr] Downloaded slog-stdlog v4.1.0 [INFO] [stderr] Downloaded wayland-egl v0.29.0 [INFO] [stderr] Downloaded wayland-protocols v0.29.0 [INFO] [stderr] Downloaded ttf-parser v0.6.2 [INFO] [stderr] Downloaded crossbeam v0.8.1 [INFO] [stderr] Downloaded mio v0.7.13 [INFO] [stderr] Downloaded ndk v0.3.0 [INFO] [stderr] Downloaded serde_derive v1.0.130 [INFO] [stderr] Downloaded instant v0.1.11 [INFO] [stderr] Downloaded cc v1.0.71 [INFO] [stderr] Downloaded libloading v0.7.1 [INFO] [stderr] Downloaded nom v7.0.0 [INFO] [stderr] Downloaded bytemuck v1.7.2 [INFO] [stderr] Downloaded serde_yaml v0.8.21 [INFO] [stderr] Downloaded appendlist v1.4.0 [INFO] [stderr] Downloaded drm-sys v0.1.1 [INFO] [stderr] Downloaded input v0.6.0 [INFO] [stderr] Downloaded crossbeam-epoch v0.9.5 [INFO] [stderr] Downloaded lock_api v0.4.5 [INFO] [stderr] Downloaded owned_ttf_parser v0.6.0 [INFO] [stderr] Downloaded smallvec v1.7.0 [INFO] [stderr] Downloaded x11-dl v2.19.1 [INFO] [stderr] Downloaded tempfile v3.2.0 [INFO] [stderr] Downloaded wayland-commons v0.29.0 [INFO] [stderr] Downloaded wayland-scanner v0.29.0 [INFO] [stderr] Downloaded wayland-server v0.29.0 [INFO] [stderr] Downloaded core-foundation-sys v0.8.2 [INFO] [stderr] Downloaded core-graphics v0.22.2 [INFO] [stderr] Downloaded mio-misc v1.2.1 [INFO] [stderr] Downloaded proc-macro-crate v1.1.0 [INFO] [stderr] Downloaded once_cell v1.8.0 [INFO] [stderr] Downloaded pkg-config v0.3.20 [INFO] [stderr] Downloaded minimal-lexical v0.1.4 [INFO] [stderr] Downloaded rustversion v1.0.5 [INFO] [stderr] Downloaded thread_local v1.1.3 [INFO] [stderr] Downloaded drm-ffi v0.2.0 [INFO] [stderr] Downloaded core-foundation v0.9.1 [INFO] [stderr] Downloaded crossbeam-queue v0.3.2 [INFO] [stderr] Downloaded rusttype v0.9.2 [INFO] [stderr] Downloaded num_enum v0.5.4 [INFO] [stderr] Downloaded ndk-glue v0.3.0 [INFO] [stderr] Downloaded ab_glyph_rasterizer v0.1.4 [INFO] [stderr] Downloaded proc-macro2 v1.0.29 [INFO] [stderr] Downloaded blake2b_simd v0.5.11 [INFO] [stderr] Downloaded crossbeam-utils v0.8.5 [INFO] [stderr] Downloaded xkbcommon v0.4.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 4b7bc2ec42719e6430d07f7d36cdce097efabb038dd9f79a4301ba157d95ae7e [INFO] running `Command { std: "docker" "start" "-a" "4b7bc2ec42719e6430d07f7d36cdce097efabb038dd9f79a4301ba157d95ae7e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "4b7bc2ec42719e6430d07f7d36cdce097efabb038dd9f79a4301ba157d95ae7e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4b7bc2ec42719e6430d07f7d36cdce097efabb038dd9f79a4301ba157d95ae7e", kill_on_drop: false }` [INFO] [stdout] 4b7bc2ec42719e6430d07f7d36cdce097efabb038dd9f79a4301ba157d95ae7e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 91b0d9660fefc7235d614d7a9a3ac6fc49d23919b08b17c173792d842ba7f73b [INFO] running `Command { std: "docker" "start" "-a" "91b0d9660fefc7235d614d7a9a3ac6fc49d23919b08b17c173792d842ba7f73b", 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 autocfg v1.0.1 [INFO] [stderr] Compiling proc-macro2 v1.0.29 [INFO] [stderr] Compiling pkg-config v0.3.20 [INFO] [stderr] Compiling unicode-xid v0.2.2 [INFO] [stderr] Compiling xml-rs v0.8.4 [INFO] [stderr] Compiling bitflags v1.2.1 [INFO] [stderr] Compiling log v0.4.14 [INFO] [stderr] Checking once_cell v1.8.0 [INFO] [stderr] Checking smallvec v1.7.0 [INFO] [stderr] Compiling crossbeam-utils v0.8.5 [INFO] [stderr] Checking scopeguard v1.1.0 [INFO] [stderr] Checking downcast-rs v1.2.0 [INFO] [stderr] Checking scoped-tls v1.0.0 [INFO] [stderr] Checking libloading v0.7.1 [INFO] [stderr] Compiling khronos_api v3.1.0 [INFO] [stderr] Compiling version_check v0.9.3 [INFO] [stderr] Compiling syn v1.0.80 [INFO] [stderr] Compiling memchr v2.4.1 [INFO] [stderr] Compiling slog v2.7.0 [INFO] [stderr] Compiling parking_lot_core v0.8.5 [INFO] [stderr] Compiling crossbeam-epoch v0.9.5 [INFO] [stderr] Compiling memoffset v0.6.4 [INFO] [stderr] Compiling num-traits v0.2.14 [INFO] [stderr] Checking dlib v0.5.0 [INFO] [stderr] Compiling num-integer v0.1.44 [INFO] [stderr] Checking instant v0.1.11 [INFO] [stderr] Compiling nix v0.18.0 [INFO] [stderr] Checking minimal-lexical v0.1.4 [INFO] [stderr] Compiling drm-sys v0.1.1 [INFO] [stderr] Compiling nom v7.0.0 [INFO] [stderr] Compiling crossbeam-queue v0.3.2 [INFO] [stderr] Checking ttf-parser v0.6.2 [INFO] [stderr] Checking crossbeam-channel v0.5.1 [INFO] [stderr] Checking lock_api v0.4.5 [INFO] [stderr] Compiling drm-fourcc v2.2.0 [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] Checking cfg-if v0.1.10 [INFO] [stderr] Checking ab_glyph_rasterizer v0.1.4 [INFO] [stderr] Compiling gl_generator v0.14.0 [INFO] [stderr] Compiling x11-dl v2.19.1 [INFO] [stderr] Compiling libdbus-sys v0.2.2 [INFO] [stderr] Checking libloading v0.6.7 [INFO] [stderr] Checking crossbeam-deque v0.8.1 [INFO] [stderr] Compiling gbm-sys v0.2.0 [INFO] [stderr] Compiling quote v1.0.10 [INFO] [stderr] Compiling input-sys v1.16.0 [INFO] [stderr] Checking ppv-lite86 v0.2.10 [INFO] [stderr] Compiling serde_derive v1.0.130 [INFO] [stderr] Checking dlib v0.4.2 [INFO] [stderr] Checking crossbeam v0.8.1 [INFO] [stderr] Compiling num-rational v0.3.2 [INFO] [stderr] Compiling num-iter v0.1.42 [INFO] [stderr] Compiling indexmap v1.7.0 [INFO] [stderr] Compiling winit v0.25.0 [INFO] [stderr] Checking owned_ttf_parser v0.6.0 [INFO] [stderr] Compiling cgmath v0.18.0 [INFO] [stderr] Compiling serde v1.0.130 [INFO] [stderr] Checking arc-swap v1.4.0 [INFO] [stderr] Compiling wayland-scanner v0.28.6 [INFO] [stderr] Compiling wayland-scanner v0.29.0 [INFO] [stderr] Checking rusttype v0.9.2 [INFO] [stderr] Checking approx v0.4.0 [INFO] [stderr] Checking thread_local v1.1.3 [INFO] [stderr] Compiling smithay v0.3.0 (https://github.com/Smithay/smithay?rev=dd6919dd5fb1ac6571a3e7dff01b12a2102131fe#dd6919dd) [INFO] [stderr] Checking hashbrown v0.11.2 [INFO] [stderr] Compiling slog-async v2.7.0 [INFO] [stderr] Compiling anyhow v1.0.44 [INFO] [stderr] Checking percent-encoding v2.1.0 [INFO] [stderr] Checking linked-hash-map v0.5.4 [INFO] [stderr] Checking remove_dir_all v0.5.3 [INFO] [stderr] Checking slog-scope v4.4.0 [INFO] [stderr] Checking slog-stdlog v4.1.0 [INFO] [stderr] Checking byteorder v1.4.3 [INFO] [stderr] Checking dtoa v0.4.8 [INFO] [stderr] Checking appendlist v1.4.0 [INFO] [stderr] Checking bytemuck v1.7.2 [INFO] [stderr] Checking yaml-rust v0.4.5 [INFO] [stderr] Checking take_mut v0.2.2 [INFO] [stderr] Checking scan_fmt v0.2.6 [INFO] [stderr] Checking edid-rs v0.1.0 [INFO] [stderr] Checking nix v0.22.2 [INFO] [stderr] Checking nix v0.20.2 [INFO] [stderr] Checking getrandom v0.2.3 [INFO] [stderr] Checking dirs v1.0.5 [INFO] [stderr] Checking mio v0.7.13 [INFO] [stderr] Checking xdg v2.3.0 [INFO] [stderr] Checking dirs-sys-next v0.1.2 [INFO] [stderr] Checking rand_core v0.6.3 [INFO] [stderr] Checking memmap2 v0.1.0 [INFO] [stderr] Checking dirs-next v2.0.0 [INFO] [stderr] Checking udev v0.6.2 [INFO] [stderr] Checking andrew v0.3.1 [INFO] [stderr] Checking time v0.1.43 [INFO] [stderr] Checking parking_lot v0.11.2 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking raw-window-handle v0.3.3 [INFO] [stderr] Checking chrono v0.4.19 [INFO] [stderr] Checking term v0.7.0 [INFO] [stderr] Checking rand v0.8.4 [INFO] [stderr] Checking input v0.6.0 [INFO] [stderr] Checking mio-misc v1.2.1 [INFO] [stderr] Compiling wayland-server v0.29.0 [INFO] [stderr] Compiling wayland-client v0.29.0 [INFO] [stderr] Checking xcursor v0.3.4 [INFO] [stderr] Compiling wayland-protocols v0.29.0 [INFO] [stderr] Checking dbus v0.9.5 [INFO] [stderr] Checking xkbcommon v0.4.0 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking image v0.23.14 [INFO] [stderr] Checking slog-term v2.8.0 [INFO] [stderr] Compiling wayland-client v0.28.6 [INFO] [stderr] Compiling wayland-protocols v0.28.6 [INFO] [stderr] Compiling fireplace v0.0.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> build.rs:15:15 [INFO] [stdout] | [INFO] [stdout] 15 | .args(&["rev-parse", "HEAD"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["rev-parse", "HEAD"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> build.rs:22:33 [INFO] [stdout] | [INFO] [stdout] 22 | let mut file = File::create(&dest.join("egl_bindings.rs")).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `dest.join("egl_bindings.rs")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> build.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | &dest.join("wl_drm.rs"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `dest.join("wl_drm.rs")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> build.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | &dest.join("wl_eglstream.rs"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `dest.join("wl_eglstream.rs")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> build.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | &dest.join("wl_eglstream_controller.rs"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `dest.join("wl_eglstream_controller.rs")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking tempfile v3.2.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 drm v0.5.0 [INFO] [stderr] Checking gbm v0.7.0 [INFO] [stderr] Checking wayland-commons v0.28.6 [INFO] [stderr] Compiling thiserror-impl v1.0.30 [INFO] [stderr] Checking wayland-egl v0.29.0 [INFO] [stderr] Checking wayland-cursor v0.28.6 [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)]` (part of `#[warn(unused)]`) on by default [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)]` (part of `#[warn(unused)]`) 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: 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: 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: `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: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:15911 [INFO] [stdout] | [INFO] [stdout] 1 | ...vent :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe {... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:16122 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Ev... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:16249 [INFO] [stdout] | [INFO] [stdout] 1 | ... Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:16358 [INFO] [stdout] | [INFO] [stdout] 1 | ... Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } }... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [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: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18420 [INFO] [stdout] | [INFO] [stdout] 1 | ...String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format ... [INFO] [stdout] | ^^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [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: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18549 [INFO] [stdout] | [INFO] [stdout] 1 | ...u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,... [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `format` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18807 [INFO] [stdout] | [INFO] [stdout] 1 | ... -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version su... [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [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: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:14308 [INFO] [stdout] | [INFO] [stdout] 1 | ... Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:14465 [INFO] [stdout] | [INFO] [stdout] 1 | ...swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argu... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:16680 [INFO] [stdout] | [INFO] [stdout] 1 | ...ps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override even... [INFO] [stdout] | ^^^^^^^^^^^ help: replace it with: `caps` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:17229 [INFO] [stdout] | [INFO] [stdout] 1 | ...Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `swapinterval` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:15911 [INFO] [stdout] | [INFO] [stdout] 1 | ...vent :: Device { name } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Str (Box :: new (unsafe {... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:16122 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt :: Format { format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (format) ,] , } , Ev... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:16249 [INFO] [stdout] | [INFO] [stdout] 1 | ... Event :: Authenticated => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Event :: Capabilities { value... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:16358 [INFO] [stdout] | [INFO] [stdout] 1 | ... Capabilities { value } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: Uint (value) ,] , } , } }... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18420 [INFO] [stdout] | [INFO] [stdout] 1 | ...String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format ... [INFO] [stdout] | ^^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18549 [INFO] [stdout] | [INFO] [stdout] 1 | ...u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,... [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `format` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18807 [INFO] [stdout] | [INFO] [stdout] 1 | ... -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg) ; } } # [doc = r" The minimal object version su... [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:14308 [INFO] [stdout] | [INFO] [stdout] 1 | ... Event :: Caps { caps } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Int (caps) ,] , } , Event... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:14465 [INFO] [stdout] | [INFO] [stdout] 1 | ...swapinterval , stream } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Int (swapinterval) , Argu... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sender_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:16680 [INFO] [stdout] | [INFO] [stdout] 1 | ...ps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [doc = "Server Swap interval override even... [INFO] [stdout] | ^^^^^^^^^^^ help: replace it with: `caps` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:17229 [INFO] [stdout] | [INFO] [stdout] 1 | ...Event :: SwapintervalOverride { swapinterval : swapinterval , stream : stream . clone () } ; self . 0 . send (msg) ; } } # [doc = ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `swapinterval` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [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)]` (part of `#[warn(unused)]`) 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)]` (part of `#[warn(unused)]`) 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)]` (part of `#[warn(unused)]`) 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: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)]` (part of `#[warn(unused)]`) 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: 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)]` (part of `#[warn(unused)]`) 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] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/backend/render.rs:50:21 [INFO] [stdout] | [INFO] [stdout] 50 | pub fn render_space<'a, R, E, F, T>( [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/render.rs:82:54 [INFO] [stdout] | [INFO] [stdout] 82 | for popup in child_popups(popups.iter(), &wl_surface) { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `wl_surface` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/render.rs:283:51 [INFO] [stdout] | [INFO] [stdout] 283 | match src_renderer.renderer.export_bitmap(&dma) { [INFO] [stdout] | ^^^^ help: change this to: `dma` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [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)]` (part of `#[warn(unused)]`) 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] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/backend/render.rs:50:21 [INFO] [stdout] | [INFO] [stdout] 50 | pub fn render_space<'a, R, E, F, T>( [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/render.rs:82:54 [INFO] [stdout] | [INFO] [stdout] 82 | for popup in child_popups(popups.iter(), &wl_surface) { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `wl_surface` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/backend/render.rs:368:17 [INFO] [stdout] | [INFO] [stdout] 368 | ffi::UNSIGNED_BYTE as u32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ffi::UNSIGNED_BYTE` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/render.rs:283:51 [INFO] [stdout] | [INFO] [stdout] 283 | match src_renderer.renderer.export_bitmap(&dma) { [INFO] [stdout] | ^^^^ help: change this to: `dma` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/udev/drm.rs:84:42 [INFO] [stdout] | [INFO] [stdout] 84 | .filter(|c| cleanup.contains(&c)) [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/backend/udev/surface/eglstream.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | / if !dp_extensions.iter().any(|x| x == "EGL_EXT_device_base") { [INFO] [stdout] 72 | | if !( [INFO] [stdout] 73 | | dp_extensions.iter().any(|x| x == "EGL_EXT_device_enumeration") [INFO] [stdout] 74 | | && dp_extensions.iter().any(|x| x == "EGL_EXT_device_query") [INFO] [stdout] ... | [INFO] [stdout] 78 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 71 ~ if !dp_extensions.iter().any(|x| x == "EGL_EXT_device_base") [INFO] [stdout] 72 ~ && !( [INFO] [stdout] 73 | dp_extensions.iter().any(|x| x == "EGL_EXT_device_enumeration") [INFO] [stdout] ... [INFO] [stdout] 76 | anyhow::bail!("Device does not support EGL_EXT_device"); [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/backend/render.rs:368:17 [INFO] [stdout] | [INFO] [stdout] 368 | ffi::UNSIGNED_BYTE as u32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ffi::UNSIGNED_BYTE` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/backend/udev/surface/eglstream.rs:286:13 [INFO] [stdout] | [INFO] [stdout] 286 | ffi::CONSUMER_AUTO_ACQUIRE_EXT as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ffi::CONSUMER_AUTO_ACQUIRE_EXT` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/backend/udev/surface/eglstream.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | ffi::CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ffi::CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/udev/drm.rs:84:42 [INFO] [stdout] | [INFO] [stdout] 84 | .filter(|c| cleanup.contains(&c)) [INFO] [stdout] | ^^ help: change this to: `c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/backend/udev/surface/eglstream.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | / if !dp_extensions.iter().any(|x| x == "EGL_EXT_device_base") { [INFO] [stdout] 72 | | if !( [INFO] [stdout] 73 | | dp_extensions.iter().any(|x| x == "EGL_EXT_device_enumeration") [INFO] [stdout] 74 | | && dp_extensions.iter().any(|x| x == "EGL_EXT_device_query") [INFO] [stdout] ... | [INFO] [stdout] 78 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 71 ~ if !dp_extensions.iter().any(|x| x == "EGL_EXT_device_base") [INFO] [stdout] 72 ~ && !( [INFO] [stdout] 73 | dp_extensions.iter().any(|x| x == "EGL_EXT_device_enumeration") [INFO] [stdout] ... [INFO] [stdout] 76 | anyhow::bail!("Device does not support EGL_EXT_device"); [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/udev/surface/mod.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | &disp, [INFO] [stdout] | ^^^^^ help: change this to: `disp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| &**x)` on an `Option` value [INFO] [stdout] --> src/backend/udev/mod.rs:130:30 [INFO] [stdout] | [INFO] [stdout] 130 | let egl_context = if driver.as_ref().map(|x| &**x) == Some("nvidia") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `driver.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] = note: `#[warn(clippy::option_as_ref_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/backend/udev/surface/eglstream.rs:286:13 [INFO] [stdout] | [INFO] [stdout] 286 | ffi::CONSUMER_AUTO_ACQUIRE_EXT as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ffi::CONSUMER_AUTO_ACQUIRE_EXT` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/backend/udev/surface/eglstream.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | ffi::CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ffi::CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| &**x)` on an `Option` value [INFO] [stdout] --> src/backend/udev/mod.rs:158:32 [INFO] [stdout] | [INFO] [stdout] 158 | let target = match driver.as_ref().map(|x| &**x) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `driver.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/backend/udev/mod.rs:202:25 [INFO] [stdout] | [INFO] [stdout] 202 | if let Some(edid) = edid_parse(&mut reader).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(edid)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 202 - if let Some(edid) = edid_parse(&mut reader).ok() { [INFO] [stdout] 202 + if let Ok(edid) = edid_parse(&mut reader) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/udev/surface/mod.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | &disp, [INFO] [stdout] | ^^^^^ help: change this to: `disp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/backend/udev/mod.rs:304:48 [INFO] [stdout] | [INFO] [stdout] 304 | socket_path.push(format!("wayland-{}", path.components().last().unwrap().as_os_str().to_string_lossy())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 304 - socket_path.push(format!("wayland-{}", path.components().last().unwrap().as_os_str().to_string_lossy())); [INFO] [stdout] 304 + socket_path.push(format!("wayland-{}", path.components().next_back().unwrap().as_os_str().to_string_lossy())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| &**x)` on an `Option` value [INFO] [stdout] --> src/backend/udev/mod.rs:360:12 [INFO] [stdout] | [INFO] [stdout] 360 | if driver.as_ref().map(|x| &**x) == Some("nvidia") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `driver.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/udev/mod.rs:361:44 [INFO] [stdout] | [INFO] [stdout] 361 | let _ = init_eglstream_globals(&mut *display.borrow_mut(), &egl_display, filter.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `{closure@mod.rs:352:22}` which implements the `Copy` trait [INFO] [stdout] --> src/backend/udev/mod.rs:361:86 [INFO] [stdout] | [INFO] [stdout] 361 | let _ = init_eglstream_globals(&mut *display.borrow_mut(), &egl_display, filter.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `filter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/udev/mod.rs:363:36 [INFO] [stdout] | [INFO] [stdout] 363 | let _ = init_wl_drm_global(&mut *display.borrow_mut(), render_node, formats.clone(), filter.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `{closure@mod.rs:352:22}` which implements the `Copy` trait [INFO] [stdout] --> src/backend/udev/mod.rs:363:94 [INFO] [stdout] | [INFO] [stdout] 363 | let _ = init_wl_drm_global(&mut *display.borrow_mut(), render_node, formats.clone(), filter.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `filter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/udev/mod.rs:364:48 [INFO] [stdout] | [INFO] [stdout] 364 | let _ = init_dmabuf_global_with_filter(&mut *display.borrow_mut(), formats, move |buf, mut ddata| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| &**x)` on an `Option` value [INFO] [stdout] --> src/backend/udev/mod.rs:130:30 [INFO] [stdout] | [INFO] [stdout] 130 | let egl_context = if driver.as_ref().map(|x| &**x) == Some("nvidia") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `driver.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] = note: `#[warn(clippy::option_as_ref_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| &**x)` on an `Option` value [INFO] [stdout] --> src/backend/udev/mod.rs:158:32 [INFO] [stdout] | [INFO] [stdout] 158 | let target = match driver.as_ref().map(|x| &**x) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `driver.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/backend/udev/mod.rs:202:25 [INFO] [stdout] | [INFO] [stdout] 202 | if let Some(edid) = edid_parse(&mut reader).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(edid)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 202 - if let Some(edid) = edid_parse(&mut reader).ok() { [INFO] [stdout] 202 + if let Ok(edid) = edid_parse(&mut reader) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/udev/mod.rs:451:47 [INFO] [stdout] | [INFO] [stdout] 451 | render_space(&**space, scale, &**popups, Some(DevId(dev_id)), renderer, frame, &mut other_backends)?; [INFO] [stdout] | ^^^^^^^^^ help: try: `&popups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/backend/udev/mod.rs:481:29 [INFO] [stdout] | [INFO] [stdout] 481 | ... &CursorImageStatus::Image(ref surface) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 481 - &CursorImageStatus::Image(ref surface) => { [INFO] [stdout] 481 + CursorImageStatus::Image(surface) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/backend/udev/mod.rs:304:48 [INFO] [stdout] | [INFO] [stdout] 304 | socket_path.push(format!("wayland-{}", path.components().last().unwrap().as_os_str().to_string_lossy())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 304 - socket_path.push(format!("wayland-{}", path.components().last().unwrap().as_os_str().to_string_lossy())); [INFO] [stdout] 304 + socket_path.push(format!("wayland-{}", path.components().next_back().unwrap().as_os_str().to_string_lossy())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/winit.rs:53:13 [INFO] [stdout] | [INFO] [stdout] 53 | &mut *state.display.borrow_mut(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut state.display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/winit.rs:89:83 [INFO] [stdout] | [INFO] [stdout] 89 | match input.dispatch_new_events(|event| state.process_winit_event(&name, event)) { [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/backend/winit.rs:92:63 [INFO] [stdout] | [INFO] [stdout] 92 | let scale = workspaces.output_by_name(&name).unwrap().scale(); [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/backend/winit.rs:93:69 [INFO] [stdout] | [INFO] [stdout] 93 | let space = workspaces.space_by_output_name(&name).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/winit.rs:97:85 [INFO] [stdout] | [INFO] [stdout] 97 | ... .render(|renderer, frame| render_space(&**space, scale, &**popups, None, renderer, frame, &mut [])) [INFO] [stdout] | ^^^^^^^^^ help: try: `&popups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| &**x)` on an `Option` value [INFO] [stdout] --> src/backend/udev/mod.rs:360:12 [INFO] [stdout] | [INFO] [stdout] 360 | if driver.as_ref().map(|x| &**x) == Some("nvidia") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `driver.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/udev/mod.rs:361:44 [INFO] [stdout] | [INFO] [stdout] 361 | let _ = init_eglstream_globals(&mut *display.borrow_mut(), &egl_display, filter.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `{closure@mod.rs:352:22}` which implements the `Copy` trait [INFO] [stdout] --> src/backend/udev/mod.rs:361:86 [INFO] [stdout] | [INFO] [stdout] 361 | let _ = init_eglstream_globals(&mut *display.borrow_mut(), &egl_display, filter.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `filter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/udev/mod.rs:363:36 [INFO] [stdout] | [INFO] [stdout] 363 | let _ = init_wl_drm_global(&mut *display.borrow_mut(), render_node, formats.clone(), filter.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `{closure@mod.rs:352:22}` which implements the `Copy` trait [INFO] [stdout] --> src/backend/udev/mod.rs:363:94 [INFO] [stdout] | [INFO] [stdout] 363 | let _ = init_wl_drm_global(&mut *display.borrow_mut(), render_node, formats.clone(), filter.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `filter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/udev/mod.rs:364:48 [INFO] [stdout] | [INFO] [stdout] 364 | let _ = init_dmabuf_global_with_filter(&mut *display.borrow_mut(), formats, move |buf, mut ddata| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/winit.rs:106:77 [INFO] [stdout] | [INFO] [stdout] 106 | state.workspaces.borrow_mut().remove_output_by_name(&name); [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/backend/winit.rs:129:65 [INFO] [stdout] | [INFO] [stdout] 129 | if let Some(output) = workspaces.output_by_name(&name) { [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/backend/winit.rs:137:70 [INFO] [stdout] | [INFO] [stdout] 137 | if let Some(space) = workspaces.space_by_output_name(&name) { [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/udev/mod.rs:451:47 [INFO] [stdout] | [INFO] [stdout] 451 | render_space(&**space, scale, &**popups, Some(DevId(dev_id)), renderer, frame, &mut other_backends)?; [INFO] [stdout] | ^^^^^^^^^ help: try: `&popups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/backend/udev/mod.rs:481:29 [INFO] [stdout] | [INFO] [stdout] 481 | ... &CursorImageStatus::Image(ref surface) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 481 - &CursorImageStatus::Image(ref surface) => { [INFO] [stdout] 481 + CursorImageStatus::Image(surface) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/winit.rs:53:13 [INFO] [stdout] | [INFO] [stdout] 53 | &mut *state.display.borrow_mut(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut state.display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/winit.rs:89:83 [INFO] [stdout] | [INFO] [stdout] 89 | match input.dispatch_new_events(|event| state.process_winit_event(&name, event)) { [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/backend/winit.rs:92:63 [INFO] [stdout] | [INFO] [stdout] 92 | let scale = workspaces.output_by_name(&name).unwrap().scale(); [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/backend/winit.rs:93:69 [INFO] [stdout] | [INFO] [stdout] 93 | let space = workspaces.space_by_output_name(&name).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/backend/winit.rs:97:85 [INFO] [stdout] | [INFO] [stdout] 97 | ... .render(|renderer, frame| render_space(&**space, scale, &**popups, None, renderer, frame, &mut [])) [INFO] [stdout] | ^^^^^^^^^ help: try: `&popups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/backend/winit.rs:106:77 [INFO] [stdout] | [INFO] [stdout] 106 | state.workspaces.borrow_mut().remove_output_by_name(&name); [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/backend/winit.rs:129:65 [INFO] [stdout] | [INFO] [stdout] 129 | if let Some(output) = workspaces.output_by_name(&name) { [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/backend/winit.rs:137:70 [INFO] [stdout] | [INFO] [stdout] 137 | if let Some(space) = workspaces.space_by_output_name(&name) { [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: suspicious use of `+` in `BitOr` impl [INFO] [stdout] --> src/handler/keyboard.rs:37:19 [INFO] [stdout] | [INFO] [stdout] 37 | modifiers += rhs; [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_arithmetic_impl [INFO] [stdout] = note: `#[warn(clippy::suspicious_arithmetic_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/handler/keyboard.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | impl Into for KeyModifier { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 42 ~ impl From for KeyModifiers { [INFO] [stdout] 43 ~ fn from(val: KeyModifier) -> Self { [INFO] [stdout] 44 | let mut modifiers = KeyModifiers { [INFO] [stdout] ... [INFO] [stdout] 51 | }; [INFO] [stdout] 52 ~ modifiers += val; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: suspicious use of `+` in `BitOr` impl [INFO] [stdout] --> src/handler/keyboard.rs:37:19 [INFO] [stdout] | [INFO] [stdout] 37 | modifiers += rhs; [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_arithmetic_impl [INFO] [stdout] = note: `#[warn(clippy::suspicious_arithmetic_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/handler/keyboard.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | impl Into for KeyModifier { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 42 ~ impl From for KeyModifiers { [INFO] [stdout] 43 ~ fn from(val: KeyModifier) -> Self { [INFO] [stdout] 44 | let mut modifiers = KeyModifiers { [INFO] [stdout] ... [INFO] [stdout] 51 | }; [INFO] [stdout] 52 ~ modifiers += val; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `unwrap_or` to construct default value [INFO] [stdout] --> src/handler/mod.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 49 | .unwrap_or(Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/handler/mod.rs:59:32 [INFO] [stdout] | [INFO] [stdout] 59 | userdata.insert_if_missing(|| Devices::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Devices::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `unwrap_or` to construct default value [INFO] [stdout] --> src/handler/mod.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 49 | .unwrap_or(Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/handler/mod.rs:59:32 [INFO] [stdout] | [INFO] [stdout] 59 | userdata.insert_if_missing(|| Devices::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Devices::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/handler/mod.rs:327:74 [INFO] [stdout] | [INFO] [stdout] 327 | ... let space = workspaces.space_by_seat(&seat).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `seat` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/handler/mod.rs:330:49 [INFO] [stdout] | [INFO] [stdout] 330 | ... if let Some(&(ref under, _)) = under.as_ref() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 330 - if let Some(&(ref under, _)) = under.as_ref() { [INFO] [stdout] 330 + if let Some((under, _)) = under.as_ref() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/handler/mod.rs:335:76 [INFO] [stdout] | [INFO] [stdout] 335 | ... .set_focus(under.as_ref().map(|&(ref s, _)| s), serial); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 335 - .set_focus(under.as_ref().map(|&(ref s, _)| s), serial); [INFO] [stdout] 335 + .set_focus(under.as_ref().map(|(s, _)| s), serial); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/handler/mod.rs:327:74 [INFO] [stdout] | [INFO] [stdout] 327 | ... let space = workspaces.space_by_seat(&seat).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `seat` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/handler/mod.rs:330:49 [INFO] [stdout] | [INFO] [stdout] 330 | ... if let Some(&(ref under, _)) = under.as_ref() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 330 - if let Some(&(ref under, _)) = under.as_ref() { [INFO] [stdout] 330 + if let Some((under, _)) = under.as_ref() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/handler/mod.rs:335:76 [INFO] [stdout] | [INFO] [stdout] 335 | ... .set_focus(under.as_ref().map(|&(ref s, _)| s), serial); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 335 - .set_focus(under.as_ref().map(|&(ref s, _)| s), serial); [INFO] [stdout] 335 + .set_focus(under.as_ref().map(|(s, _)| s), serial); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/handler/mod.rs:465:54 [INFO] [stdout] | [INFO] [stdout] 465 | let space = workspaces.space_by_seat(&seat).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `seat` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/handler/mod.rs:465:54 [INFO] [stdout] | [INFO] [stdout] 465 | let space = workspaces.space_by_seat(&seat).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `seat` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/logger.rs:26:1 [INFO] [stdout] | [INFO] [stdout] 26 | / impl Default for Color { [INFO] [stdout] 27 | | fn default() -> Color { [INFO] [stdout] 28 | | Color::Auto [INFO] [stdout] 29 | | } [INFO] [stdout] 30 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 20 + #[derive(Default)] [INFO] [stdout] 21 | pub enum Color { [INFO] [stdout] 22 ~ #[default] [INFO] [stdout] 23 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/logger.rs:26:1 [INFO] [stdout] | [INFO] [stdout] 26 | / impl Default for Color { [INFO] [stdout] 27 | | fn default() -> Color { [INFO] [stdout] 28 | | Color::Auto [INFO] [stdout] 29 | | } [INFO] [stdout] 30 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 20 + #[derive(Default)] [INFO] [stdout] 21 | pub enum Color { [INFO] [stdout] 22 ~ #[default] [INFO] [stdout] 23 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/logger.rs:39:1 [INFO] [stdout] | [INFO] [stdout] 39 | / impl Default for Mode { [INFO] [stdout] 40 | | fn default() -> Mode { [INFO] [stdout] 41 | | Mode::Compact [INFO] [stdout] 42 | | } [INFO] [stdout] 43 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 34 + #[derive(Default)] [INFO] [stdout] 35 | pub enum Mode { [INFO] [stdout] 36 ~ #[default] [INFO] [stdout] 37 ~ Compact, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/logger.rs:39:1 [INFO] [stdout] | [INFO] [stdout] 39 | / impl Default for Mode { [INFO] [stdout] 40 | | fn default() -> Mode { [INFO] [stdout] 41 | | Mode::Compact [INFO] [stdout] 42 | | } [INFO] [stdout] 43 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 34 + #[derive(Default)] [INFO] [stdout] 35 | pub enum Mode { [INFO] [stdout] 36 ~ #[default] [INFO] [stdout] 37 ~ Compact, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/shell/layout/floating.rs:93:1 [INFO] [stdout] | [INFO] [stdout] 93 | / impl Default for ResizeState { [INFO] [stdout] 94 | | fn default() -> Self { [INFO] [stdout] 95 | | ResizeState::NotResizing [INFO] [stdout] 96 | | } [INFO] [stdout] 97 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 82 + #[derive(Default)] [INFO] [stdout] 83 | pub enum ResizeState { [INFO] [stdout] 84 | /// The surface is not being resized. [INFO] [stdout] 85 ~ #[default] [INFO] [stdout] 86 ~ NotResizing, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/shell/layout/floating.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | i32::max_value() [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 154 - i32::max_value() [INFO] [stdout] 154 + i32::MAX [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/shell/layout/floating.rs:159:13 [INFO] [stdout] | [INFO] [stdout] 159 | i32::max_value() [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 159 - i32::max_value() [INFO] [stdout] 159 + i32::MAX [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/shell/layout/floating.rs:93:1 [INFO] [stdout] | [INFO] [stdout] 93 | / impl Default for ResizeState { [INFO] [stdout] 94 | | fn default() -> Self { [INFO] [stdout] 95 | | ResizeState::NotResizing [INFO] [stdout] 96 | | } [INFO] [stdout] 97 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 82 + #[derive(Default)] [INFO] [stdout] 83 | pub enum ResizeState { [INFO] [stdout] 84 | /// The surface is not being resized. [INFO] [stdout] 85 ~ #[default] [INFO] [stdout] 86 ~ NotResizing, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/shell/layout/floating.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | i32::max_value() [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 154 - i32::max_value() [INFO] [stdout] 154 + i32::MAX [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/shell/layout/floating.rs:159:13 [INFO] [stdout] | [INFO] [stdout] 159 | i32::max_value() [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 159 - i32::max_value() [INFO] [stdout] 159 + i32::MAX [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/shell/layout/mod.rs:60:10 [INFO] [stdout] | [INFO] [stdout] 60 | ) -> Box, Rectangle)> + 'a>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/layout/mod.rs:77:49 [INFO] [stdout] | [INFO] [stdout] 77 | SurfaceData::send_frame(&mut *states.cached_state.current(), time) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut states.cached_state.current()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/shell/output.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / (size.w == 1600 && size.h == 900) [INFO] [stdout] 45 | | || (size.w == 1600 && size.h == 1000) [INFO] [stdout] | |_____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 44 - (size.w == 1600 && size.h == 900) [INFO] [stdout] 45 - || (size.w == 1600 && size.h == 1000) [INFO] [stdout] 44 + !(size.w != 1600 || size.h != 900 && size.h != 1000) [INFO] [stdout] | [INFO] [stdout] 44 - (size.w == 1600 && size.h == 900) [INFO] [stdout] 45 - || (size.w == 1600 && size.h == 1000) [INFO] [stdout] 44 + (size.h == 1000 || size.h == 900) && size.w == 1600 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/shell/layout/mod.rs:60:10 [INFO] [stdout] | [INFO] [stdout] 60 | ) -> Box, Rectangle)> + 'a>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Size` which implements the `Copy` trait [INFO] [stdout] --> src/shell/output.rs:63:29 [INFO] [stdout] | [INFO] [stdout] 63 | let physical_size = physical.size.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `physical.size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/layout/mod.rs:77:49 [INFO] [stdout] | [INFO] [stdout] 77 | SurfaceData::send_frame(&mut *states.cached_state.current(), time) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut states.cached_state.current()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/shell/output.rs:67:50 [INFO] [stdout] | [INFO] [stdout] 67 | let scale = if height < HIDPI_MIN_HEIGHT { [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 68 | | 1.0 [INFO] [stdout] 69 | | } else if phys_size_is_aspect_ratio(&physical_size) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/shell/output.rs:69:61 [INFO] [stdout] | [INFO] [stdout] 69 | } else if phys_size_is_aspect_ratio(&physical_size) { [INFO] [stdout] | _____________________________________________________________^ [INFO] [stdout] 70 | | 1.0 [INFO] [stdout] 71 | | } else if physical_size.h == 0 || physical_size.w == 0 { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/shell/output.rs:69:61 [INFO] [stdout] | [INFO] [stdout] 69 | } else if phys_size_is_aspect_ratio(&physical_size) { [INFO] [stdout] | _____________________________________________________________^ [INFO] [stdout] 70 | | 1.0 [INFO] [stdout] 71 | | } else if physical_size.h == 0 || physical_size.w == 0 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/shell/output.rs:71:64 [INFO] [stdout] | [INFO] [stdout] 71 | } else if physical_size.h == 0 || physical_size.w == 0 { [INFO] [stdout] | ________________________________________________________________^ [INFO] [stdout] 72 | | 1.0 [INFO] [stdout] 73 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/shell/output.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / (size.w == 1600 && size.h == 900) [INFO] [stdout] 45 | | || (size.w == 1600 && size.h == 1000) [INFO] [stdout] | |_____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 44 - (size.w == 1600 && size.h == 900) [INFO] [stdout] 45 - || (size.w == 1600 && size.h == 1000) [INFO] [stdout] 44 + !(size.w != 1600 || size.h != 900 && size.h != 1000) [INFO] [stdout] | [INFO] [stdout] 44 - (size.w == 1600 && size.h == 900) [INFO] [stdout] 45 - || (size.w == 1600 && size.h == 1000) [INFO] [stdout] 44 + (size.h == 1000 || size.h == 900) && size.w == 1600 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Size` which implements the `Copy` trait [INFO] [stdout] --> src/shell/output.rs:63:29 [INFO] [stdout] | [INFO] [stdout] 63 | let physical_size = physical.size.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `physical.size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/shell/output.rs:67:50 [INFO] [stdout] | [INFO] [stdout] 67 | let scale = if height < HIDPI_MIN_HEIGHT { [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 68 | | 1.0 [INFO] [stdout] 69 | | } else if phys_size_is_aspect_ratio(&physical_size) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/shell/output.rs:69:61 [INFO] [stdout] | [INFO] [stdout] 69 | } else if phys_size_is_aspect_ratio(&physical_size) { [INFO] [stdout] | _____________________________________________________________^ [INFO] [stdout] 70 | | 1.0 [INFO] [stdout] 71 | | } else if physical_size.h == 0 || physical_size.w == 0 { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/shell/output.rs:69:61 [INFO] [stdout] | [INFO] [stdout] 69 | } else if phys_size_is_aspect_ratio(&physical_size) { [INFO] [stdout] | _____________________________________________________________^ [INFO] [stdout] 70 | | 1.0 [INFO] [stdout] 71 | | } else if physical_size.h == 0 || physical_size.w == 0 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/shell/output.rs:71:64 [INFO] [stdout] | [INFO] [stdout] 71 | } else if physical_size.h == 0 || physical_size.w == 0 { [INFO] [stdout] | ________________________________________________________________^ [INFO] [stdout] 72 | | 1.0 [INFO] [stdout] 73 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/shell/window.rs:92:26 [INFO] [stdout] | [INFO] [stdout] 92 | let wl_surface = match self.get_surface() { [INFO] [stdout] | __________________________^ [INFO] [stdout] 93 | | Some(s) => s, [INFO] [stdout] 94 | | None => return None, [INFO] [stdout] 95 | | }; [INFO] [stdout] | |_________^ help: try instead: `self.get_surface()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/shell/window.rs:161:9 [INFO] [stdout] | [INFO] [stdout] 156 | / let mut window = Window { [INFO] [stdout] 157 | | location, [INFO] [stdout] 158 | | size: size.unwrap_or((0, 0).into()), [INFO] [stdout] 159 | | toplevel, [INFO] [stdout] 160 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 161 | window [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 156 ~ [INFO] [stdout] 157 ~ Window { [INFO] [stdout] 158 + location, [INFO] [stdout] 159 + size: size.unwrap_or((0, 0).into()), [INFO] [stdout] 160 + toplevel, [INFO] [stdout] 161 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/window.rs:191:33 [INFO] [stdout] | [INFO] [stdout] 191 | ... &*states.cached_state.current(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&states.cached_state.current()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/shell/window.rs:92:26 [INFO] [stdout] | [INFO] [stdout] 92 | let wl_surface = match self.get_surface() { [INFO] [stdout] | __________________________^ [INFO] [stdout] 93 | | Some(s) => s, [INFO] [stdout] 94 | | None => return None, [INFO] [stdout] 95 | | }; [INFO] [stdout] | |_________^ help: try instead: `self.get_surface()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/shell/window.rs:161:9 [INFO] [stdout] | [INFO] [stdout] 156 | / let mut window = Window { [INFO] [stdout] 157 | | location, [INFO] [stdout] 158 | | size: size.unwrap_or((0, 0).into()), [INFO] [stdout] 159 | | toplevel, [INFO] [stdout] 160 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 161 | window [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 156 ~ [INFO] [stdout] 157 ~ Window { [INFO] [stdout] 158 + location, [INFO] [stdout] 159 + size: size.unwrap_or((0, 0).into()), [INFO] [stdout] 160 + toplevel, [INFO] [stdout] 161 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/window.rs:191:33 [INFO] [stdout] | [INFO] [stdout] 191 | ... &*states.cached_state.current(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&states.cached_state.current()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/shell/workspace.rs:46:21 [INFO] [stdout] | [INFO] [stdout] 46 | for i in 1..::std::u8::MAX { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 46 - for i in 1..::std::u8::MAX { [INFO] [stdout] 46 + for i in 1..u8::MAX { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/workspace.rs:99:13 [INFO] [stdout] | [INFO] [stdout] 99 | &mut *self.display.borrow_mut(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut self.display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/shell/workspace.rs:46:21 [INFO] [stdout] | [INFO] [stdout] 46 | for i in 1..::std::u8::MAX { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 46 - for i in 1..::std::u8::MAX { [INFO] [stdout] 46 + for i in 1..u8::MAX { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/workspace.rs:128:57 [INFO] [stdout] | [INFO] [stdout] 128 | for output in self.outputs.iter().filter(|o| !f(*o)) { [INFO] [stdout] | ^^ help: try: `o` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/workspace.rs:99:13 [INFO] [stdout] | [INFO] [stdout] 99 | &mut *self.display.borrow_mut(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut self.display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/shell/workspace.rs:167:19 [INFO] [stdout] | [INFO] [stdout] 167 | pub fn spaces<'a>(&'a mut self) -> impl Iterator> [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 167 - pub fn spaces<'a>(&'a mut self) -> impl Iterator> [INFO] [stdout] 167 + pub fn spaces(&mut self) -> impl Iterator> [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/shell/workspace.rs:172:33 [INFO] [stdout] | [INFO] [stdout] 172 | pub fn space_by_output_name<'a, N>(&'a mut self, name: N) -> Option<&'a mut Box> [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 172 - pub fn space_by_output_name<'a, N>(&'a mut self, name: N) -> Option<&'a mut Box> [INFO] [stdout] 172 + pub fn space_by_output_name(&mut self, name: N) -> Option<&mut Box> [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/shell/workspace.rs:195:9 [INFO] [stdout] | [INFO] [stdout] 195 | / for (_, space) in self.spaces.iter_mut() { [INFO] [stdout] 196 | | if space [INFO] [stdout] 197 | | .windows() [INFO] [stdout] 198 | | .any(|k| k.get_surface().map(|x| x == surface).unwrap_or(false)) [INFO] [stdout] ... | [INFO] [stdout] 203 | | None [INFO] [stdout] | |____________^ [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] help: replace with an iterator [INFO] [stdout] | [INFO] [stdout] 195 ~ self.spaces.iter_mut().map(|(_, space)| space).find(|space| space [INFO] [stdout] 196 + .windows() [INFO] [stdout] 197 + .any(|k| k.get_surface().map(|x| x == surface).unwrap_or(false))).map(|v| v as _) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/workspace.rs:128:57 [INFO] [stdout] | [INFO] [stdout] 128 | for output in self.outputs.iter().filter(|o| !f(*o)) { [INFO] [stdout] | ^^ help: try: `o` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/shell/workspace.rs:167:19 [INFO] [stdout] | [INFO] [stdout] 167 | pub fn spaces<'a>(&'a mut self) -> impl Iterator> [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 167 - pub fn spaces<'a>(&'a mut self) -> impl Iterator> [INFO] [stdout] 167 + pub fn spaces(&mut self) -> impl Iterator> [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/shell/workspace.rs:172:33 [INFO] [stdout] | [INFO] [stdout] 172 | pub fn space_by_output_name<'a, N>(&'a mut self, name: N) -> Option<&'a mut Box> [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 172 - pub fn space_by_output_name<'a, N>(&'a mut self, name: N) -> Option<&'a mut Box> [INFO] [stdout] 172 + pub fn space_by_output_name(&mut self, name: N) -> Option<&mut Box> [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/shell/workspace.rs:195:9 [INFO] [stdout] | [INFO] [stdout] 195 | / for (_, space) in self.spaces.iter_mut() { [INFO] [stdout] 196 | | if space [INFO] [stdout] 197 | | .windows() [INFO] [stdout] 198 | | .any(|k| k.get_surface().map(|x| x == surface).unwrap_or(false)) [INFO] [stdout] ... | [INFO] [stdout] 203 | | None [INFO] [stdout] | |____________^ [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] help: replace with an iterator [INFO] [stdout] | [INFO] [stdout] 195 ~ self.spaces.iter_mut().map(|(_, space)| space).find(|space| space [INFO] [stdout] 196 + .windows() [INFO] [stdout] 197 + .any(|k| k.get_surface().map(|x| x == surface).unwrap_or(false))).map(|v| v as _) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | &mut *display.borrow_mut(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:63:38 [INFO] [stdout] | [INFO] [stdout] 63 | surface_commit(&surface, &mut *workspaces, &mut *popups) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `&mut workspaces` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:63:56 [INFO] [stdout] | [INFO] [stdout] 63 | surface_commit(&surface, &mut *workspaces, &mut *popups) [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&mut popups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | &mut *display.borrow_mut(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/shell/mod.rs:81:58 [INFO] [stdout] | [INFO] [stdout] 81 | let space = workspaces.space_by_seat(&seat).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `seat` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/shell/mod.rs:182:65 [INFO] [stdout] | [INFO] [stdout] 182 | ... workspaces.space_by_surface(&wl_surface).map(|x| x.id()); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `wl_surface` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/shell/mod.rs:185:69 [INFO] [stdout] | [INFO] [stdout] 185 | ... workspaces.space_by_surface(&wl_surface) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `wl_surface` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/shell/mod.rs:200:57 [INFO] [stdout] | [INFO] [stdout] 200 | ... workspaces.space_by_surface(&wl_surface) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `wl_surface` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | &mut *display.borrow_mut(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:63:38 [INFO] [stdout] | [INFO] [stdout] 63 | surface_commit(&surface, &mut *workspaces, &mut *popups) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `&mut workspaces` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:63:56 [INFO] [stdout] | [INFO] [stdout] 63 | surface_commit(&surface, &mut *workspaces, &mut *popups) [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&mut popups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | &mut *display.borrow_mut(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `Some(..)` [INFO] [stdout] --> src/shell/mod.rs:298:43 [INFO] [stdout] | [INFO] [stdout] 298 | if let Some(old_buffer) = std::mem::replace(&mut self.buffer, Some(buffer)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::replace()` instead: `self.buffer.replace(buffer)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_some [INFO] [stdout] = note: `#[warn(clippy::mem_replace_option_with_some)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/shell/mod.rs:81:58 [INFO] [stdout] | [INFO] [stdout] 81 | let space = workspaces.space_by_seat(&seat).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `seat` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/shell/mod.rs:369:13 [INFO] [stdout] | [INFO] [stdout] 369 | popups: &mut Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 369 - popups: &mut Vec, [INFO] [stdout] 369 + popups: &mut [PopupKind], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:389:36 [INFO] [stdout] | [INFO] [stdout] 389 | data.update_buffer(&mut *states.cached_state.current::()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut states.cached_state.current::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/shell/mod.rs:182:65 [INFO] [stdout] | [INFO] [stdout] 182 | ... workspaces.space_by_surface(&wl_surface).map(|x| x.id()); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `wl_surface` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/shell/mod.rs:185:69 [INFO] [stdout] | [INFO] [stdout] 185 | ... workspaces.space_by_surface(&wl_surface) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `wl_surface` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/shell/mod.rs:200:57 [INFO] [stdout] | [INFO] [stdout] 200 | ... workspaces.space_by_surface(&wl_surface) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `wl_surface` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/state.rs:83:53 [INFO] [stdout] | [INFO] [stdout] 83 | let initial_seat = crate::handler::add_seat(&mut *display.borrow_mut(), "seat-1".into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `Some(..)` [INFO] [stdout] --> src/shell/mod.rs:298:43 [INFO] [stdout] | [INFO] [stdout] 298 | if let Some(old_buffer) = std::mem::replace(&mut self.buffer, Some(buffer)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::replace()` instead: `self.buffer.replace(buffer)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_some [INFO] [stdout] = note: `#[warn(clippy::mem_replace_option_with_some)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/shell/mod.rs:369:13 [INFO] [stdout] | [INFO] [stdout] 369 | popups: &mut Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 369 - popups: &mut Vec, [INFO] [stdout] 369 + popups: &mut [PopupKind], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `0 as *const _` detected [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:80 [INFO] [stdout] | [INFO] [stdout] 1 | ...; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NU... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::null::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_ptr [INFO] [stdout] = note: `#[warn(clippy::zero_ptr)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/shell/mod.rs:389:36 [INFO] [stdout] | [INFO] [stdout] 389 | data.update_buffer(&mut *states.cached_state.current::()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut states.cached_state.current::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:970 [INFO] [stdout] | [INFO] [stdout] 1 | ...rror :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , ... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/state.rs:83:53 [INFO] [stdout] | [INFO] [stdout] 83 | let initial_seat = crate::handler::add_seat(&mut *display.borrow_mut(), "seat-1".into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut display.borrow_mut()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `0 as *const _` detected [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:80 [INFO] [stdout] | [INFO] [stdout] 1 | ...; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NU... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::null::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_ptr [INFO] [stdout] = note: `#[warn(clippy::zero_ptr)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5033 [INFO] [stdout] | [INFO] [stdout] 1 | ... (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitma... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:970 [INFO] [stdout] | [INFO] [stdout] 1 | ...rror :: InvalidName) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , ... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5439 [INFO] [stdout] | [INFO] [stdout] 1 | ...Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaust... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5540 [INFO] [stdout] | [INFO] [stdout] 1 | ...[derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id :... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] = note: `#[warn(clippy::empty_docs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5583 [INFO] [stdout] | [INFO] [stdout] 1 | ...m Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , ... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5734 [INFO] [stdout] | [INFO] [stdout] 1 | ...i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffe... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:7785 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5033 [INFO] [stdout] | [INFO] [stdout] 1 | ... (Format :: Xbgr16f) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "wl_drm capability bitma... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5439 [INFO] [stdout] | [INFO] [stdout] 1 | ...Capability :: Prime) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaust... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5540 [INFO] [stdout] | [INFO] [stdout] 1 | ...[derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id :... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] = note: `#[warn(clippy::empty_docs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5583 [INFO] [stdout] | [INFO] [stdout] 1 | ...m Request { # [doc = ""] Authenticate { id : u32 , } , # [doc = ""] CreateBuffer { id : Main < super :: wl_buffer :: WlBuffer > , ... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:5734 [INFO] [stdout] | [INFO] [stdout] 1 | ...i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { id : Main < super :: wl_buffer :: WlBuffe... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:7785 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Authenticate { .. } ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14090 [INFO] [stdout] | [INFO] [stdout] 1 | ...: _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where ... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [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 { & wl_drm_events as * const _ } , } ; } [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 , }) } , _ => 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 { & wl_drm_events as * const _ } , } ; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14339 [INFO] [stdout] | [INFO] [stdout] 1 | ...# [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u3... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14381 [INFO] [stdout] | [INFO] [stdout] 1 | ...enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [do... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14422 [INFO] [stdout] | [INFO] [stdout] 1 | ... String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , ... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14451 [INFO] [stdout] | [INFO] [stdout] 1 | ...rmat { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup ... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:15150 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , E... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:15640 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14090 [INFO] [stdout] | [INFO] [stdout] 1 | ...: _args [9] . i , stride2 : _args [10] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where ... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [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 { & wl_drm_events as * const _ } , } ; } [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 , }) } , _ => 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 { & wl_drm_events as * const _ } , } ; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14339 [INFO] [stdout] | [INFO] [stdout] 1 | ...# [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u3... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14381 [INFO] [stdout] | [INFO] [stdout] 1 | ...enum Event { # [doc = ""] Device { name : String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [do... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18341 [INFO] [stdout] | [INFO] [stdout] 1 | ...rface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14422 [INFO] [stdout] | [INFO] [stdout] 1 | ... String , } , # [doc = ""] Format { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , ... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18383 [INFO] [stdout] | [INFO] [stdout] 1 | ...[doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # ... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:14451 [INFO] [stdout] | [INFO] [stdout] 1 | ...rmat { format : u32 , } , # [doc = ""] Authenticated , # [doc = ""] Capabilities { value : u32 , } , } impl super :: MessageGroup ... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18471 [INFO] [stdout] | [INFO] [stdout] 1 | ... :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event ... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18512 [INFO] [stdout] | [INFO] [stdout] 1 | ... [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; ... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18604 [INFO] [stdout] | [INFO] [stdout] 1 | ...Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Aut... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:15150 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Device { .. } => 0 , E... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18639 [INFO] [stdout] | [INFO] [stdout] 1 | ... ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18718 [INFO] [stdout] | [INFO] [stdout] 1 | ...g = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = E... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:15640 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18764 [INFO] [stdout] | [INFO] [stdout] 1 | ... = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18341 [INFO] [stdout] | [INFO] [stdout] 1 | ...rface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn device (& self , name : String) -> () { let msg = Event... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18383 [INFO] [stdout] | [INFO] [stdout] 1 | ...[doc = ""] pub fn device (& self , name : String) -> () { let msg = Event :: Device { name : name } ; self . 0 . send (msg) ; } # ... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `0 as *const _` detected [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:80 [INFO] [stdout] | [INFO] [stdout] 1 | ...; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NU... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::null::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_ptr [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18471 [INFO] [stdout] | [INFO] [stdout] 1 | ... :: Device { name : name } ; self . 0 . send (msg) ; } # [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event ... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Bad` [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:674 [INFO] [stdout] | [INFO] [stdout] 1 | ...e] 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 , } im... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18512 [INFO] [stdout] | [INFO] [stdout] 1 | ... [doc = ""] pub fn format (& self , format : u32) -> () { let msg = Event :: Format { format : format } ; self . 0 . send (msg) ; ... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:1129 [INFO] [stdout] | [INFO] [stdout] 1 | ...Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n-... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18604 [INFO] [stdout] | [INFO] [stdout] 1 | ...Format { format : format } ; self . 0 . send (msg) ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Aut... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:2136 [INFO] [stdout] | [INFO] [stdout] 1 | ...andleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attribu... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:3415 [INFO] [stdout] | [INFO] [stdout] 1 | ...Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaust... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18639 [INFO] [stdout] | [INFO] [stdout] 1 | ... ; } # [doc = ""] pub fn authenticated (& self ,) -> () { let msg = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty doc comment [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18718 [INFO] [stdout] | [INFO] [stdout] 1 | ...g = Event :: Authenticated ; self . 0 . send (msg) ; } # [doc = ""] pub fn capabilities (& self , value : u32) -> () { let msg = E... [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing or filling it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:3904 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:4015 [INFO] [stdout] | [INFO] [stdout] 1 | ...t < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::in... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `Err (())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18764 [INFO] [stdout] | [INFO] [stdout] 1 | ... = ""] pub fn capabilities (& self , value : u32) -> () { let msg = Event :: Capabilities { value : value } ; self . 0 . send (msg... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:4327 [INFO] [stdout] | [INFO] [stdout] 1 | ...ment ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where ... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [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 { & wl_eglstream_display_events as * const _ } , } ; } [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 { _ => 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 { & wl_eglstream_display_events as * const _ } , } ; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:4307 [INFO] [stdout] | [INFO] [stdout] 1 | ...uest , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `return Err (())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:4962 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Stream` [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:7643 [INFO] [stdout] | [INFO] [stdout] 1 | ...e] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } im... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:8021 [INFO] [stdout] | [INFO] [stdout] 1 | ...Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaust... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `0 as *const _` detected [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:80 [INFO] [stdout] | [INFO] [stdout] 1 | ...; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NU... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::null::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_ptr [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Bad` [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:674 [INFO] [stdout] | [INFO] [stdout] 1 | ...e] 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 , } im... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:9511 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:1129 [INFO] [stdout] | [INFO] [stdout] 1 | ...Error :: BadAddress) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream handle type\n\n-... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:2136 [INFO] [stdout] | [INFO] [stdout] 1 | ...andleType :: Socket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream creation attribu... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:3415 [INFO] [stdout] | [INFO] [stdout] 1 | ...Attrib :: YInverted) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaust... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:3904 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:12258 [INFO] [stdout] | [INFO] [stdout] 1 | ... _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where ... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [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 { & wl_eglstream_display_events as * const _ } , } ; } [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 , }) } , _ => 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: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:13657 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Eve... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:4015 [INFO] [stdout] | [INFO] [stdout] 1 | ...t < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Request::in... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `Err (())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:14039 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:4327 [INFO] [stdout] | [INFO] [stdout] 1 | ...ment ,) -> Result < Request , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where ... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [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 { & wl_eglstream_display_events as * const _ } , } ; } [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 { _ => 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 { & wl_eglstream_display_events as * const _ } , } ; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:4307 [INFO] [stdout] | [INFO] [stdout] 1 | ...uest , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `return Err (())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:16645 [INFO] [stdout] | [INFO] [stdout] 1 | ...e to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [d... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:4962 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:17178 [INFO] [stdout] | [INFO] [stdout] 1 | ... i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , ... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `0 as *const _` detected [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:80 [INFO] [stdout] | [INFO] [stdout] 1 | ...; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::null::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_ptr [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Stream` [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:7643 [INFO] [stdout] | [INFO] [stdout] 1 | ...e] pub enum Cap { # [doc = "Stream connection with FD"] StreamFd = 1 , # [doc = "Stream inet connection"] StreamInet = 2 , # [doc = "Stream unix connection"] StreamSocket = 4 , } im... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:1370 [INFO] [stdout] | [INFO] [stdout] 1 | ...sentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachm... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:8021 [INFO] [stdout] | [INFO] [stdout] 1 | ...Cap :: StreamSocket) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaust... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:2259 [INFO] [stdout] | [INFO] [stdout] 1 | ...ttrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaust... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:3626 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsu... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:4074 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:9511 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateStream { .. } ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:6239 [INFO] [stdout] | [INFO] [stdout] 1 | ...* const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where ... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [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 { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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 () } , }) } , _ => 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 { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:12258 [INFO] [stdout] | [INFO] [stdout] 1 | ... _ ,) . into () , interval : _args [1] . i , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where ... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [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 { & wl_eglstream_display_events as * const _ } , } ; } [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 , }) } , _ => 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: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:6874 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:13657 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: Caps { .. } => 0 , Eve... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:14039 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/wayland/eglstream.rs:178:29 [INFO] [stdout] | [INFO] [stdout] 178 | ... return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 177 - surface.as_ref().post_error(wl_eglstream::Error::BadAlloc.to_raw(), String::from("Failed to connect EGLStream to consumer")); [INFO] [stdout] 178 - return; [INFO] [stdout] 177 + surface.as_ref().post_error(wl_eglstream::Error::BadAlloc.to_raw(), String::from("Failed to connect EGLStream to consumer")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:16645 [INFO] [stdout] | [INFO] [stdout] 1 | ...e to be used."] pub fn caps (& self , caps : i32) -> () { let msg = Event :: Caps { caps : caps } ; self . 0 . send (msg) ; } # [d... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:17178 [INFO] [stdout] | [INFO] [stdout] 1 | ... i32 , stream : & super :: wl_buffer :: WlBuffer) -> () { let msg = Event :: SwapintervalOverride { swapinterval : swapinterval , ... [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `0 as *const _` detected [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:80 [INFO] [stdout] | [INFO] [stdout] 1 | ...; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::null::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_ptr [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:1370 [INFO] [stdout] | [INFO] [stdout] 1 | ...sentMode :: Mailbox) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [doc = "Stream consumer attachm... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:2259 [INFO] [stdout] | [INFO] [stdout] 1 | ...ttrib :: FifoLength) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaust... [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:3626 [INFO] [stdout] | [INFO] [stdout] 1 | ...ctor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: AttachEglstreamConsu... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `false` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:4074 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:6239 [INFO] [stdout] | [INFO] [stdout] 1 | ...* const u8 , array . size) . to_owned () } , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where ... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [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 { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [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 () } , }) } , _ => 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 { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:6874 [INFO] [stdout] | [INFO] [stdout] 1 | ...ion < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , (... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the match body instead: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [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] warning: unneeded `return` statement [INFO] [stdout] --> src/wayland/eglstream.rs:178:29 [INFO] [stdout] | [INFO] [stdout] 178 | ... return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 177 - surface.as_ref().post_error(wl_eglstream::Error::BadAlloc.to_raw(), String::from("Failed to connect EGLStream to consumer")); [INFO] [stdout] 178 - return; [INFO] [stdout] 177 + surface.as_ref().post_error(wl_eglstream::Error::BadAlloc.to_raw(), String::from("Failed to connect EGLStream to consumer")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::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)]` (part of `#[warn(unused)]`) 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] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18294 [INFO] [stdout] | [INFO] [stdout] 1 | ...() -> * 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:19842 [INFO] [stdout] | [INFO] [stdout] 1 | ...nterface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:20183 [INFO] [stdout] | [INFO] [stdout] 1 | ...terface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:20693 [INFO] [stdout] | [INFO] [stdout] 1 | ...terface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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: 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] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:21381 [INFO] [stdout] | [INFO] [stdout] 1 | ... 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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: unused `std::result::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)]` (part of `#[warn(unused)]`) 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] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:21563 [INFO] [stdout] | [INFO] [stdout] 1 | ...st c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:21782 [INFO] [stdout] | [INFO] [stdout] 1 | ..._char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buff... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:18294 [INFO] [stdout] | [INFO] [stdout] 1 | ...() -> * 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22008 [INFO] [stdout] | [INFO] [stdout] 1 | ...c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:19842 [INFO] [stdout] | [INFO] [stdout] 1 | ...nterface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22341 [INFO] [stdout] | [INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * cons... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:20183 [INFO] [stdout] | [INFO] [stdout] 1 | ...terface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22511 [INFO] [stdout] | [INFO] [stdout] 1 | ... 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:20693 [INFO] [stdout] | [INFO] [stdout] 1 | ...terface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22687 [INFO] [stdout] | [INFO] [stdout] 1 | ... 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22863 [INFO] [stdout] | [INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for ... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:21381 [INFO] [stdout] | [INFO] [stdout] 1 | ... 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:21563 [INFO] [stdout] | [INFO] [stdout] 1 | ...st c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:23133 [INFO] [stdout] | [INFO] [stdout] 1 | ...equest_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_events as *... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const wl_drm_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:21782 [INFO] [stdout] | [INFO] [stdout] 1 | ..._char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buff... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/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 interf... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22008 [INFO] [stdout] | [INFO] [stdout] 1 | ...c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:16326 [INFO] [stdout] | [INFO] [stdout] 1 | ... const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities even... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22341 [INFO] [stdout] | [INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * cons... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:17871 [INFO] [stdout] | [INFO] [stdout] 1 | ...nterface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22511 [INFO] [stdout] | [INFO] [stdout] 1 | ... 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:18218 [INFO] [stdout] | [INFO] [stdout] 1 | ...nterface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22687 [INFO] [stdout] | [INFO] [stdout] 1 | ... 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:18620 [INFO] [stdout] | [INFO] [stdout] 1 | ...ar , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:18837 [INFO] [stdout] | [INFO] [stdout] 1 | ...ar , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:22863 [INFO] [stdout] | [INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for ... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:19055 [INFO] [stdout] | [INFO] [stdout] 1 | ...t wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_drm.rs:1:23133 [INFO] [stdout] | [INFO] [stdout] 1 | ...equest_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_events as *... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:19407 [INFO] [stdout] | [INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * con... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const wl_drm_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:19593 [INFO] [stdout] | [INFO] [stdout] 1 | ..., types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/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 interf... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:19936 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstrea... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:16326 [INFO] [stdout] | [INFO] [stdout] 1 | ... const wl_interface { unsafe { & wl_eglstream_display_interface } } } impl WlEglstreamDisplay { # [doc = "Server capabilities even... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:20021 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt_count : 2 , events : unsafe { & wl_eglstream_display_events as * const _ } , } ; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const wl_eglstream_display_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/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 obj... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:17871 [INFO] [stdout] | [INFO] [stdout] 1 | ...nterface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:18218 [INFO] [stdout] | [INFO] [stdout] 1 | ...nterface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:8867 [INFO] [stdout] | [INFO] [stdout] 1 | ...terface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:8950 [INFO] [stdout] | [INFO] [stdout] 1 | ...wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_contr... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:9150 [INFO] [stdout] | [INFO] [stdout] 1 | ...terface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:18620 [INFO] [stdout] | [INFO] [stdout] 1 | ...ar , types : unsafe { & wl_eglstream_display_requests_create_stream_types as * const _ } , } , wl_message { name : b"swap_interval... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:9233 [INFO] [stdout] | [INFO] [stdout] 1 | ...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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:9646 [INFO] [stdout] | [INFO] [stdout] 1 | ...es : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/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 represe... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:18837 [INFO] [stdout] | [INFO] [stdout] 1 | ...ar , types : unsafe { & wl_eglstream_display_requests_swap_interval_types as * const _ } , } ,] ; static mut wl_eglstream_display_... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:10266 [INFO] [stdout] | [INFO] [stdout] 1 | ...unt : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:19055 [INFO] [stdout] | [INFO] [stdout] 1 | ...t wl_interface , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; # [doc = r" C-representation ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:19407 [INFO] [stdout] | [INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"swapinterval_override\0" as * con... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:19593 [INFO] [stdout] | [INFO] [stdout] 1 | ..., types : unsafe { & wl_eglstream_display_events_swapinterval_override_types as * const _ } , } ,] ; # [doc = r" C representation ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:19936 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 2 , requests : unsafe { & wl_eglstream_display_requests as * const _ } , event_count : 2 , events : unsafe { & wl_eglstrea... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream.rs:1:20021 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt_count : 2 , events : unsafe { & wl_eglstream_display_events as * const _ } , } ; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const wl_eglstream_display_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/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 obj... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:8867 [INFO] [stdout] | [INFO] [stdout] 1 | ...terface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:8950 [INFO] [stdout] | [INFO] [stdout] 1 | ...wl_interface } , unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } ,] ; static mut wl_eglstream_contr... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:9150 [INFO] [stdout] | [INFO] [stdout] 1 | ...terface ; 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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:9233 [INFO] [stdout] | [INFO] [stdout] 1 | ...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: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:9646 [INFO] [stdout] | [INFO] [stdout] 1 | ...es : unsafe { & wl_eglstream_controller_requests_attach_eglstream_consumer_types as * const _ } , } , wl_message { name : b"attach... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/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 represe... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const 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 [INFO] [stdout] --> /opt/rustwide/target/debug/build/fireplace-5fdf406f385955a0/out/wl_eglstream_controller.rs:1:10266 [INFO] [stdout] | [INFO] [stdout] 1 | ...unt : 2 , requests : unsafe { & wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: use `&raw const` 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 { &raw const wl_eglstream_controller_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 08s [INFO] [stderr] warning: the following packages contain code that will be rejected by a future version of Rust: smithay v0.3.0 (https://github.com/Smithay/smithay?rev=dd6919dd5fb1ac6571a3e7dff01b12a2102131fe#dd6919dd) [INFO] [stderr] note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1` [INFO] running `Command { std: "docker" "inspect" "91b0d9660fefc7235d614d7a9a3ac6fc49d23919b08b17c173792d842ba7f73b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "91b0d9660fefc7235d614d7a9a3ac6fc49d23919b08b17c173792d842ba7f73b", kill_on_drop: false }` [INFO] [stdout] 91b0d9660fefc7235d614d7a9a3ac6fc49d23919b08b17c173792d842ba7f73b