/
githubmirror
/
ostree
Обзор
Документация
Войти
/
githubmirror
/
ostree
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
rust-bindings/src/auto/blob_reader.rs
38 строк
1 KB
Alexander Larsson
rust: Regenerate and release 0.20.5
26 сен 2025, 16:38
26 сен 2025, 16:38
3d4a8a5
Код
Авторство
О чём код?
// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files // DO NOT EDIT use crate::{ffi}; use glib::{prelude::*}; #[cfg(feature = "v2016_5")] #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] use glib::{translate::*}; glib::wrapper! { #[doc(alias = "OstreeBlobReader")] pub struct BlobReader(Interface<ffi::OstreeBlobReader, ffi::OstreeBlobReaderInterface>); match fn { type_ => || ffi::ostree_blob_reader_get_type(), } } impl BlobReader { pub const NONE: Option<&'static BlobReader> = None; } pub trait BlobReaderExt: IsA<BlobReader> + 'static { #[cfg(feature = "v2016_5")] #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] #[doc(alias = "ostree_blob_reader_read_blob")] fn read_blob(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::Bytes>, glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let ret = ffi::ostree_blob_reader_read_blob(self.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } } impl<O: IsA<BlobReader>> BlobReaderExt for O {}