Skip to main content

spice_client_glib/auto/
usb_device.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::translate::*;
8
9glib::wrapper! {
10    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
11    pub struct UsbDevice(Boxed<ffi::SpiceUsbDevice>);
12
13    match fn {
14        copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::spice_usb_device_get_type(), ptr as *mut _) as *mut ffi::SpiceUsbDevice,
15        free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::spice_usb_device_get_type(), ptr as *mut _),
16        type_ => || ffi::spice_usb_device_get_type(),
17    }
18}
19
20impl UsbDevice {
21    #[doc(alias = "spice_usb_device_get_description")]
22    #[doc(alias = "get_description")]
23    pub fn description(&mut self, format: Option<&str>) -> Option<glib::GString> {
24        unsafe {
25            from_glib_full(ffi::spice_usb_device_get_description(
26                self.to_glib_none_mut().0,
27                format.to_glib_none().0,
28            ))
29        }
30    }
31}