Clarify reasons for async exclude

This commit is contained in:
Felix Krull 2019-05-21 19:57:30 +02:00 committed by Colin Walters
parent 3decba546e
commit 2452dee279
2 changed files with 67 additions and 3 deletions

View File

@ -81,13 +81,13 @@ status = "generate"
name = "OSTree.Repo"
status = "generate"
[[object.function]]
# not sure what's wrong with this method; might be a gir issue
# crashes while generating, not sure what's wrong with this; might be a gir issue
name = "write_metadata_async"
ignore = true
[[object.function]]
# async generates bad code (for now?); revisit with newer gir
pattern = ".+_async"
# issue with the return type of content (thinks guchar** is u8)
name = "write_content_async"
ignore = true
[[object]]

View File

@ -163,6 +163,39 @@ impl Repo {
// unsafe { TODO: call ostree_sys:ostree_repo_export_tree_to_archive() }
//}
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn find_remotes_async<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>, R: FnOnce(Result</*Ignored*/Vec<RepoFinderResult>, Error>) + Send + 'static>(&self, refs: &[&CollectionRef], options: Option<&glib::Variant>, finders: /*Ignored*/&[RepoFinder], progress: Option<&P>, cancellable: Option<&Q>, callback: R) {
// unsafe { TODO: call ostree_sys:ostree_repo_find_remotes_async() }
//}
//#[cfg(feature = "futures")]
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn find_remotes_async_future<P: IsA<AsyncProgress> + Clone + 'static>(&self, refs: &[&CollectionRef], options: Option<&glib::Variant>, finders: /*Ignored*/&[RepoFinder], progress: Option<&P>) -> Box_<future::Future<Output = Result</*Ignored*/Vec<RepoFinderResult>, Error>> + std::marker::Unpin> {
//use gio::GioFuture;
//use fragile::Fragile;
//let refs = refs.clone();
//let options = options.map(ToOwned::to_owned);
//let finders = finders.clone();
//let progress = progress.map(ToOwned::to_owned);
//GioFuture::new(self, move |obj, send| {
// let cancellable = gio::Cancellable::new();
// let send = Fragile::new(send);
// obj.find_remotes_async(
// &refs,
// options.as_ref().map(::std::borrow::Borrow::borrow),
// &finders,
// progress.as_ref().map(::std::borrow::Borrow::borrow),
// Some(&cancellable),
// move |res| {
// let _ = send.into_inner().send(res);
// },
// );
// cancellable
//})
//}
#[cfg(any(feature = "v2017_15", feature = "dox"))]
pub fn fsck_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<(), Error> {
unsafe {
@ -464,6 +497,37 @@ impl Repo {
}
}
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn pull_from_remotes_async<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>, R: FnOnce(Result<(), Error>) + Send + 'static>(&self, results: /*Ignored*/&[&RepoFinderResult], options: Option<&glib::Variant>, progress: Option<&P>, cancellable: Option<&Q>, callback: R) {
// unsafe { TODO: call ostree_sys:ostree_repo_pull_from_remotes_async() }
//}
//#[cfg(feature = "futures")]
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn pull_from_remotes_async_future<P: IsA<AsyncProgress> + Clone + 'static>(&self, results: /*Ignored*/&[&RepoFinderResult], options: Option<&glib::Variant>, progress: Option<&P>) -> Box_<future::Future<Output = Result<(), Error>> + std::marker::Unpin> {
//use gio::GioFuture;
//use fragile::Fragile;
//let results = results.clone();
//let options = options.map(ToOwned::to_owned);
//let progress = progress.map(ToOwned::to_owned);
//GioFuture::new(self, move |obj, send| {
// let cancellable = gio::Cancellable::new();
// let send = Fragile::new(send);
// obj.pull_from_remotes_async(
// &results,
// options.as_ref().map(::std::borrow::Borrow::borrow),
// progress.as_ref().map(::std::borrow::Borrow::borrow),
// Some(&cancellable),
// move |res| {
// let _ = send.into_inner().send(res);
// },
// );
// cancellable
//})
//}
pub fn pull_one_dir<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();