diff --git a/rust-bindings/rust/conf/ostree.toml b/rust-bindings/rust/conf/ostree.toml index f8636fe0..21ec029f 100644 --- a/rust-bindings/rust/conf/ostree.toml +++ b/rust-bindings/rust/conf/ostree.toml @@ -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]] diff --git a/rust-bindings/rust/src/auto/repo.rs b/rust-bindings/rust/src/auto/repo.rs index dfe9f3e4..7a6f96ca 100644 --- a/rust-bindings/rust/src/auto/repo.rs +++ b/rust-bindings/rust/src/auto/repo.rs @@ -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, Q: IsA, R: FnOnce(Result, 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 + Clone + 'static>(&self, refs: &[&CollectionRef], options: Option<&glib::Variant>, finders: /*Ignored*/&[RepoFinder], progress: Option<&P>) -> Box_, 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>(&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, Q: IsA, 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 + Clone + 'static>(&self, results: /*Ignored*/&[&RepoFinderResult], options: Option<&glib::Variant>, progress: Option<&P>) -> Box_> + 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, Q: IsA>(&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();