[INFO] cloning repository https://github.com/Drakulix/nvscreencopy
[INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Drakulix/nvscreencopy" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDrakulix%2Fnvscreencopy", kill_on_drop: false }`
[INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDrakulix%2Fnvscreencopy'...
[INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }`
[INFO] [stdout] a0c4ddbf2be38808f217623b2d496e156305858f
[INFO] building Drakulix/nvscreencopy against try#334963c956d25708feab489a3816ae63f639355d for pr-135216
[INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDrakulix%2Fnvscreencopy" "/workspace/builds/worker-3-tc2/source", kill_on_drop: false }`
[INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc2/source'...
[INFO] [stderr] done.
[INFO] validating manifest of git repo https://github.com/Drakulix/nvscreencopy on toolchain 334963c956d25708feab489a3816ae63f639355d
[INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+334963c956d25708feab489a3816ae63f639355d" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }`
[INFO] started tweaking git repo https://github.com/Drakulix/nvscreencopy
[INFO] finished tweaking git repo https://github.com/Drakulix/nvscreencopy
[INFO] tweaked toml for git repo https://github.com/Drakulix/nvscreencopy written to /workspace/builds/worker-3-tc2/source/Cargo.toml
[INFO] crate git repo https://github.com/Drakulix/nvscreencopy 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" "+334963c956d25708feab489a3816ae63f639355d" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:f3a9d4ad9d972b27faf3965f35b62e55ba32bbce8f20bc8fe909558a86702fde" "/opt/rustwide/cargo-home/bin/cargo" "+334963c956d25708feab489a3816ae63f639355d" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }`
[INFO] [stdout] 205f6c880c64ac29f6d15007356fd347e96f5554147e936488f77e0ff34d40bf
[INFO] running `Command { std: "docker" "start" "-a" "205f6c880c64ac29f6d15007356fd347e96f5554147e936488f77e0ff34d40bf", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "inspect" "205f6c880c64ac29f6d15007356fd347e96f5554147e936488f77e0ff34d40bf", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "205f6c880c64ac29f6d15007356fd347e96f5554147e936488f77e0ff34d40bf", kill_on_drop: false }`
[INFO] [stdout] 205f6c880c64ac29f6d15007356fd347e96f5554147e936488f77e0ff34d40bf
[INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-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:f3a9d4ad9d972b27faf3965f35b62e55ba32bbce8f20bc8fe909558a86702fde" "/opt/rustwide/cargo-home/bin/cargo" "+334963c956d25708feab489a3816ae63f639355d" "build" "--frozen" "--message-format=json", kill_on_drop: false }`
[INFO] [stdout] 2df55c73b36418f2a681a7e2134fb60a4279d74f47300197de045caa6a322d06
[INFO] running `Command { std: "docker" "start" "-a" "2df55c73b36418f2a681a7e2134fb60a4279d74f47300197de045caa6a322d06", kill_on_drop: false }`
[INFO] [stderr]    Compiling libc v0.2.98
[INFO] [stderr]    Compiling proc-macro2 v1.0.28
[INFO] [stderr]    Compiling xml-rs v0.8.3
[INFO] [stderr]    Compiling bitflags v1.2.1
[INFO] [stderr]    Compiling pkg-config v0.3.19
[INFO] [stderr]    Compiling memoffset v0.6.4
[INFO] [stderr]    Compiling smallvec v1.6.1
[INFO] [stderr]    Compiling libloading v0.7.0
[INFO] [stderr]    Compiling slog v2.7.0
[INFO] [stderr]    Compiling dlib v0.5.0
[INFO] [stderr]    Compiling memchr v2.3.4
[INFO] [stderr]    Compiling nom v6.2.1
[INFO] [stderr]    Compiling drm-sys v0.1.1
[INFO] [stderr]    Compiling syn v1.0.74
[INFO] [stderr]    Compiling wayland-sys v0.28.6
[INFO] [stderr]    Compiling wayland-sys v0.29.0
[INFO] [stderr]    Compiling libudev-sys v0.1.4
[INFO] [stderr]    Compiling gl_generator v0.14.0
[INFO] [stderr]    Compiling num-integer v0.1.44
[INFO] [stderr]    Compiling input-sys v1.15.1
[INFO] [stderr]    Compiling crossbeam-utils v0.8.5
[INFO] [stderr]    Compiling drm-fourcc v2.1.1
[INFO] [stderr]    Compiling quote v1.0.9
[INFO] [stderr]    Compiling scoped-tls v1.0.0
[INFO] [stderr]    Compiling arc-swap v1.3.0
[INFO] [stderr]    Compiling cgmath v0.18.0
[INFO] [stderr]    Compiling slog-scope v4.4.0
[INFO] [stderr]    Compiling wayland-scanner v0.28.6
[INFO] [stderr]    Compiling wayland-scanner v0.29.0
[INFO] [stderr]    Compiling smithay v0.3.0
[INFO] [stderr]    Compiling approx v0.4.0
[INFO] [stderr]    Compiling thread_local v1.1.3
[INFO] [stderr]    Compiling unicode-width v0.1.8
[INFO] [stderr]    Compiling anyhow v1.0.42
[INFO] [stderr]    Compiling nix v0.22.0
[INFO] [stderr]    Compiling nix v0.20.0
[INFO] [stderr]    Compiling getrandom v0.2.3
[INFO] [stderr]    Compiling rand_core v0.6.3
[INFO] [stderr]    Compiling rand_chacha v0.3.1
[INFO] [stderr]    Compiling dirs-sys-next v0.1.2
[INFO] [stderr]    Compiling wayland-server v0.29.0
[INFO] [stderr]    Compiling wayland-client v0.28.6
[INFO] [stderr]    Compiling wayland-protocols v0.28.6
[INFO] [stderr]    Compiling wayland-protocols v0.29.0
[INFO] [stderr]    Compiling udev v0.6.2
[INFO] [stderr]    Compiling xcursor v0.3.3
[INFO] [stderr]    Compiling dirs-next v2.0.0
[INFO] [stderr]    Compiling rand v0.8.4
[INFO] [stderr]    Compiling time v0.1.43
[INFO] [stderr]    Compiling nix v0.19.1
[INFO] [stderr]    Compiling atty v0.2.14
[INFO] [stderr]    Compiling nix v0.21.0
[INFO] [stderr]    Compiling thiserror-impl v1.0.26
[INFO] [stderr]    Compiling input v0.6.0
[INFO] [stderr]    Compiling wayland-commons v0.28.6
[INFO] [stderr]    Compiling thiserror v1.0.26
[INFO] [stderr]    Compiling tempfile v3.2.0
[INFO] [stderr]    Compiling wayland-commons v0.29.0
[INFO] [stderr]    Compiling drm-ffi v0.2.0
[INFO] [stderr]    Compiling drm v0.5.0
[INFO] [stderr]    Compiling chrono v0.4.19
[INFO] [stderr]    Compiling wayland-cursor v0.28.6
[INFO] [stderr]    Compiling term v0.7.0
[INFO] [stderr]    Compiling calloop v0.7.2
[INFO] [stderr]    Compiling calloop v0.9.0
[INFO] [stderr]    Compiling nvscreencopy v0.1.0 (/opt/rustwide/workdir)
[INFO] [stderr]    Compiling xkbcommon v0.4.0
[INFO] [stderr]    Compiling memmap2 v0.2.3
[INFO] [stderr]    Compiling textwrap v0.11.0
[INFO] [stderr]    Compiling slog-stdlog v4.1.0
[INFO] [stderr]    Compiling crossbeam-channel v0.5.1
[INFO] [stderr]    Compiling scan_fmt v0.2.6
[INFO] [stderr]    Compiling appendlist v1.4.0
[INFO] [stderr]    Compiling strsim v0.8.0
[INFO] [stderr]    Compiling take_mut v0.2.2
[INFO] [stderr]    Compiling ansi_term v0.11.0
[INFO] [stderr]    Compiling slog-async v2.6.0
[INFO] [stderr]    Compiling clap v2.33.3
[INFO] [stderr]    Compiling slog-term v2.8.0
[INFO] [stderr]    Compiling smithay-client-toolkit v0.14.0
[INFO] [stdout] warning: variable does not need to be mutable
[INFO] [stdout]   --> src/main.rs:89:9
[INFO] [stdout]    |
[INFO] [stdout] 89 |     let mut state: &mut WaylandState = data.get().unwrap();
[INFO] [stdout]    |         ----^^^^^
[INFO] [stdout]    |         |
[INFO] [stdout]    |         help: remove this `mut`
[INFO] [stdout]    |
[INFO] [stdout]    = note: `#[warn(unused_mut)]` on by default
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:16253
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...e () -> * const wl_interface { unsafe { & wl_drm_interface } } } impl WlDrm { # [doc = ""] pub fn authenticate (& self , id : u32) -> ...
[INFO] [stdout]   |                                            ^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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: `#[warn(static_mut_refs)]` 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_AUTHENTICATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PLANAR_BUFFER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_PRIME_BUFFER_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DEVICE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FORMAT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_AUTHENTICATED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CAPABILITIES_SINCE : u32 = 1u32 ; static mut wl_drm_requests_create_buffer_types : [* const wl_interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_planar_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut wl_drm_requests_create_prime_buffer_types : [* const wl_interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_requests : [wl_message ; 4] = [wl_message { name : b"authenticate\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuu\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0" as * const u8 as * const c_char , signature : b"nuiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer\0" as * const u8 as * const c_char , signature : b"2nhiiuiiiiii\0" as * const u8 as * const c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut wl_drm_events : [wl_message ; 4] = [wl_message { name : b"device\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"capabilities\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut wl_drm_interface : wl_interface = wl_interface { name : b"wl_drm\0" as * const u8 as * const c_char , version : 2 , request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ~~~~~~~~~~
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:18892
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..._interface ; 6] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ...
[INFO] [stdout]   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:19233
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ...
[INFO] [stdout]   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:19743
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...interface ; 11] = [unsafe { & super :: wl_buffer :: wl_buffer_interface as * const wl_interface } , NULLPTR as * const wl_interface , ...
[INFO] [stdout]   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:20431
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"create_buffer\0" as * const u8 as *...
[INFO] [stdout]   |                                               ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:20613
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...onst c_char , types : unsafe { & wl_drm_requests_create_buffer_types as * const _ } , } , wl_message { name : b"create_planar_buffer\0...
[INFO] [stdout]   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:20832
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... c_char , types : unsafe { & wl_drm_requests_create_planar_buffer_types as * const _ } , } , wl_message { name : b"create_prime_buffer...
[INFO] [stdout]   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:21058
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...t c_char , types : unsafe { & wl_drm_requests_create_prime_buffer_types as * const _ } , } ,] ; # [doc = r" C-representation of the me...
[INFO] [stdout]   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:21391
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"format\0" as * const u8 as * const ...
[INFO] [stdout]   |                                               ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:21561
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"authenticated\0" as * const u8 as *...
[INFO] [stdout]   |                                               ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:21737
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"capabilities\0" as * const u8 as * ...
[INFO] [stdout]   |                                               ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:21913
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in...
[INFO] [stdout]   |                                               ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:22183
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... request_count : 4 , requests : unsafe { & wl_drm_requests as * const _ } , event_count : 4 , events : unsafe { & wl_drm_events as * c...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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 is discouraged
[INFO] [stdout]  --> /opt/rustwide/target/debug/build/nvscreencopy-ebc35041d319dc9c/out/drm.rs:1:22254
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..._ } , event_count : 4 , events : unsafe { & wl_drm_events as * const _ } , } ; }
[INFO] [stdout]   |                                              ^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
[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] 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 :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [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 { name : u32 , width : i32 , height : i32 , stride : u32 , format : u32 , } , # [doc = ""] CreatePlanarBuffer { 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 { 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 :: ProxyMap ; 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 , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Authenticate { id } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (id) ,] , } , Request :: CreateBuffer { name , width , height , stride , format } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (stride) , Argument :: Uint (format) ,] , } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [Argument :: NewId (0) , Argument :: Fd (name) , Argument :: Int (width) , Argument :: Int (height) , Argument :: Uint (format) , Argument :: Int (offset0) , Argument :: Int (stride0) , Argument :: Int (offset1) , Argument :: Int (stride1) , Argument :: Int (offset2) , Argument :: Int (stride2) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Authenticate { id } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = id ; f (0 , & mut _args_array) } , Request :: CreateBuffer { name , width , height , stride , format } => { let mut _args_array : [wl_argument ; 6] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = stride ; _args_array [5] . u = format ; f (1 , & mut _args_array) } , Request :: CreatePlanarBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (2 , & mut _args_array) } , Request :: CreatePrimeBuffer { name , width , height , format , offset0 , stride0 , offset1 , stride1 , offset2 , stride2 } => { let mut _args_array : [wl_argument ; 11] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . h = name ; _args_array [2] . i = width ; _args_array [3] . i = height ; _args_array [4] . u = format ; _args_array [5] . i = offset0 ; _args_array [6] . i = stride0 ; _args_array [7] . i = offset1 ; _args_array [8] . i = stride1 ; _args_array [9] . i = offset2 ; _args_array [10] . i = stride2 ; f (3 , & mut _args_array) } , } } } # [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 :: ProxyMap ; 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 , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Device { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: Format { format : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 2 => Ok (Event :: Authenticated) , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Capabilities { value : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Device { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Format { format : _args [0] . u , }) } , 2 => { Ok (Event :: Authenticated) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Capabilities { value : _args [0] . u , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct WlDrm (Proxy < WlDrm >) ; impl AsRef < Proxy < WlDrm >> for WlDrm { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < WlDrm >> for WlDrm { # [inline] fn from (value : Proxy < Self >) -> Self { WlDrm (value) } } impl From < WlDrm > for Proxy < 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 authenticate (& self , id : u32) -> () { let msg = Request :: Authenticate { id : id } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = ""] pub fn create_buffer (& self , name : u32 , width : i32 , height : i32 , stride : u32 , format : u32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreateBuffer { name : name , width : width , height : height , stride : stride , format : format } ; self . 0 . send (msg , None) . unwrap () } # [doc = ""] pub fn create_planar_buffer (& self , name : u32 , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePlanarBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } # [doc = "Only available since version 2 of the interface."] pub fn create_prime_buffer (& self , name : :: std :: os :: unix :: io :: RawFd , width : i32 , height : i32 , format : u32 , offset0 : i32 , stride0 : i32 , offset1 : i32 , stride1 : i32 , offset2 : i32 , stride2 : i32) -> Main < super :: wl_buffer :: WlBuffer > { let msg = Request :: CreatePrimeBuffer { name : name , width : width , height : height , format : format , offset0 : offset0 , stride0 : stride0 , offset1 : offset1 , stride1 : stride1 , offset2 : offset2 , stride2 : stride2 } ; self . 0 . send (msg , None) . unwrap () } } # [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] error: linking with `cc` failed: exit status: 1
[INFO] [stdout]   |
[INFO] [stdout]   = note: LC_ALL="C" PATH="/opt/rustwide/rustup-home/toolchains/334963c956d25708feab489a3816ae63f639355d/lib/rustlib/x86_64-unknown-linux-gnu/bin:/opt/rustwide/rustup-home/toolchains/334963c956d25708feab489a3816ae63f639355d/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/opt/rustwide/cargo-home/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcGjKZzh/symbols.o" "<17 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/opt/rustwide/target/debug/deps/{libslog_term-24c56dc44bd24a03.rlib,libterm-639ab62dcfecfcc4.rlib,libdirs_next-4c0f4c6dbeaf99cb.rlib,libdirs_sys_next-1d7b31cd5e3d569e.rlib,libchrono-705b3d8b10304c97.rlib,libnum_integer-b817797635ccb465.rlib,libtime-bf15223e88ff70b3.rlib,libslog_async-5222f55f7582bac0.rlib,libthread_local-a0a2853f567db105.rlib,libtake_mut-7e27eecaecf716c7.rlib,libcrossbeam_channel-e7a8ebe0aa51fd00.rlib,libcrossbeam_utils-fd3575eccd5e45da.rlib,libsmithay_client_toolkit-7426f68acd2cf789.rlib,libwayland_cursor-82a66770982ab6a8.rlib,libxcursor-00f64c6382bc1d31.rlib,libnom-e3ae15de17d058c7.rlib,libmemchr-914f8b61b7405b25.rlib,libmemmap2-c6de38cad5a86dc4.rlib,libwayland_protocols-6dda2a653d21663d.rlib,libwayland_client-2203b5be0e6110e2.rlib,libscoped_tls-563b287bd664763c.rlib,libwayland_commons-7ead02579e45d8d8.rlib,libnix-e4b3f7994fa9a44c.rlib,libwayland_sys-be26872020de42b3.rlib,libcalloop-f74ba50356685732.rlib,libnix-08f064b237810117.rlib,libdlib-c21c985287d76525.rlib,libsmithay-ff9f33591d09adf7.rlib,libslog_stdlog-ae7749d222b7d62b.rlib,libslog_scope-7227cfd5e14e925a.rlib,libarc_swap-e14929392f2cab20.rlib,libinput-95acc281ea0e13d0.rlib,libinput_sys-bccb7d9bc2cb5371.rlib,libappendlist-4ae2544a34ce9ce3.rlib,liblazy_static-2bb390fee0230a38.rlib,libxkbcommon-3c3eaeda1d086425.rlib,libthiserror-3b1d7b76a48cd7eb.rlib,libtempfile-d58784fa476beb5d.rlib,librand-0b8e548d5e459c06.rlib,librand_chacha-23156cff7c21f7f9.rlib,libppv_lite86-88ed22677a4c0286.rlib,librand_core-5c76672ad9a28414.rlib,libgetrandom-9c391a04b9a3cad9.rlib,libremove_dir_all-988c28ce6bbf4cfc.rlib,libwayland_protocols-3e7beec86a22bc20.rlib,libudev-9e1b8537686bccee.rlib,liblibudev_sys-4ccee712d09ee4c7.rlib,liblibloading-264a54599aadeb4c.rlib,libscan_fmt-8dffd25abe306d51.rlib,libwayland_server-f9af22607285c671.rlib,libdowncast_rs-ffbd8a7d19c70af3.rlib,libwayland_commons-7f81694f5443d1fb.rlib,libsmallvec-97844d2104066b54.rlib,libonce_cell-5132bd2988d9c7dd.rlib,libwayland_sys-f1c0d5c9994b94e6.rlib,libcgmath-2a9f65e863af5136.rlib,libapprox-0e72d185f882e925.rlib,libnum_traits-b9da938e7378284d.rlib,libdrm-e008a1ec3359486c.rlib,libdrm_fourcc-84e4923e90609284.rlib,libdrm_ffi-babf68e11cf638b2.rlib,libdrm_sys-5e9475be41d79e09.rlib,libnix-b208b1c4e0352244.rlib,libslog-d473ad71a0f027bc.rlib,libclap-f2f6e52e8338d643.rlib,libvec_map-ecbce826993378bd.rlib,libtextwrap-3db3c65cc235fb8e.rlib,libunicode_width-8f833626c49fb0ed.rlib,libstrsim-1c33ff29e0d45111.rlib,libatty-a38bc29aceaa9121.rlib,libansi_term-dc29728339138c52.rlib,libcalloop-6f83158379756967.rlib,liblog-c47319b5e74b5781.rlib,libnix-880f0a8f26242bed.rlib,libbitflags-ee4b6a8effb9c17a.rlib,libmemoffset-31eb278b9616aa00.rlib,libcfg_if-33ef6c02a07f9fec.rlib,liblibc-960e26e5cab55434.rlib,libanyhow-10eb2bf2a12c2021.rlib}" "/opt/rustwide/rustup-home/toolchains/334963c956d25708feab489a3816ae63f639355d/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-d6f1d924b2f4233e.rlib,libpanic_unwind-00eb06e39850f679.rlib,libobject-d0382f11baa011b6.rlib,libmemchr-b7e2e2c1a7e4643d.rlib,libaddr2line-30ced7f1999cfa29.rlib,libgimli-3ee7e14c58e31ebd.rlib,librustc_demangle-a4f649bba77ffcc5.rlib,libstd_detect-c89a3ce7ad7c3dbd.rlib,libhashbrown-e1ce1d3d110c6707.rlib,librustc_std_workspace_alloc-e0604fecbf0f39dc.rlib,libminiz_oxide-0a9c6172f04822cc.rlib,libadler2-14a33f7117abcee7.rlib,libunwind-24c16adbe5e57356.rlib,libcfg_if-d2688d4a5c8e415b.rlib,liblibc-8ff7ba6d97853f27.rlib,liballoc-5c001d095eb077ec.rlib,librustc_std_workspace_core-395a38b8e0851c9b.rlib,libcore-d453bab70303062c.rlib,libcompiler_builtins-dd545221bb4f4734.rlib}" "-Wl,-Bdynamic" "-linput" "-lxkbcommon" "-ludev" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-B/opt/rustwide/rustup-home/toolchains/334963c956d25708feab489a3816ae63f639355d/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/opt/rustwide/rustup-home/toolchains/334963c956d25708feab489a3816ae63f639355d/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/opt/rustwide/target/debug/deps/nvscreencopy-b6ab4d344eca6bc8" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
[INFO] [stdout]   = note: some arguments are omitted. use `--verbose` to show all linker arguments
[INFO] [stdout]   = note: rust-lld: error: unable to find library -linput
[INFO] [stdout]           collect2: error: ld returned 1 exit status
[INFO] [stdout]           
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stderr] error: could not compile `nvscreencopy` (bin "nvscreencopy") due to 1 previous error; 15 warnings emitted
[INFO] running `Command { std: "docker" "inspect" "2df55c73b36418f2a681a7e2134fb60a4279d74f47300197de045caa6a322d06", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "2df55c73b36418f2a681a7e2134fb60a4279d74f47300197de045caa6a322d06", kill_on_drop: false }`
[INFO] [stdout] 2df55c73b36418f2a681a7e2134fb60a4279d74f47300197de045caa6a322d06
