1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from gir-files (https://github.com/gtk-rs/gir-files) 3 // DO NOT EDIT 4 5 use crate::Icon; 6 use crate::LoadableIcon; 7 use glib::translate::*; 8 use std::fmt; 9 10 glib::wrapper! { 11 #[doc(alias = "GBytesIcon")] 12 pub struct BytesIcon(Object<ffi::GBytesIcon>) @implements Icon, LoadableIcon; 13 14 match fn { 15 type_ => || ffi::g_bytes_icon_get_type(), 16 } 17 } 18 19 impl BytesIcon { 20 #[doc(alias = "g_bytes_icon_new")] new(bytes: &glib::Bytes) -> BytesIcon21 pub fn new(bytes: &glib::Bytes) -> BytesIcon { 22 unsafe { from_glib_full(ffi::g_bytes_icon_new(bytes.to_glib_none().0)) } 23 } 24 25 #[doc(alias = "g_bytes_icon_get_bytes")] 26 #[doc(alias = "get_bytes")] bytes(&self) -> glib::Bytes27 pub fn bytes(&self) -> glib::Bytes { 28 unsafe { from_glib_none(ffi::g_bytes_icon_get_bytes(self.to_glib_none().0)) } 29 } 30 } 31 32 impl fmt::Display for BytesIcon { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result33 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 34 f.write_str("BytesIcon") 35 } 36 } 37