gio/auto/
bytes_icon.rs

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
5use gio_sys;
6use glib;
7use glib::translate::*;
8use std::fmt;
9use Icon;
10use LoadableIcon;
11
12glib_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
20impl BytesIcon {
21    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
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
30impl fmt::Display for BytesIcon {
31    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
32        write!(f, "BytesIcon")
33    }
34}