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 gio_sys; 6 use glib; 7 use glib::translate::*; 8 use std::fmt; 9 use Icon; 10 use LoadableIcon; 11 12 glib_wrapper! { 13 pub struct BytesIcon(Object<gio_sys::GBytesIcon, BytesIconClass>) @implements Icon, LoadableIcon; 14 15 match fn { 16 get_type => || gio_sys::g_bytes_icon_get_type(), 17 } 18 } 19 20 impl BytesIcon { new(bytes: &glib::Bytes) -> BytesIcon21 pub fn new(bytes: &glib::Bytes) -> BytesIcon { 22 unsafe { from_glib_full(gio_sys::g_bytes_icon_new(bytes.to_glib_none().0)) } 23 } 24 get_bytes(&self) -> Option<glib::Bytes>25 pub fn get_bytes(&self) -> Option<glib::Bytes> { 26 unsafe { from_glib_none(gio_sys::g_bytes_icon_get_bytes(self.to_glib_none().0)) } 27 } 28 } 29 30 impl fmt::Display for BytesIcon { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result31 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 32 write!(f, "BytesIcon") 33 } 34 } 35