From 48de8595821ea0e9e6d2df2f69a8a27f8fd157c3 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Fri, 28 Jun 2019 20:46:38 +0200 Subject: [PATCH] conf: remove a problematic function that was fixed in gir --- rust-bindings/rust/conf/ostree.toml | 5 +---- rust-bindings/rust/src/auto/repo.rs | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/rust-bindings/rust/conf/ostree.toml b/rust-bindings/rust/conf/ostree.toml index c17812d6..2cc3591a 100644 --- a/rust-bindings/rust/conf/ostree.toml +++ b/rust-bindings/rust/conf/ostree.toml @@ -130,14 +130,11 @@ status = "generate" [[object]] name = "OSTree.Repo" status = "generate" - [[object.function]] - # this one crashes gir, somehow - name = "write_metadata_async" - ignore = true [[object.function]] # this one generates a guchar** incorrectly name = "write_content_async" ignore = true + [[object.function]] # these fail because of issues with zero-terminated arrays pattern = "find_remotes_async|pull_from_remotes_async" diff --git a/rust-bindings/rust/src/auto/repo.rs b/rust-bindings/rust/src/auto/repo.rs index ad7103fa..4efab7cb 100644 --- a/rust-bindings/rust/src/auto/repo.rs +++ b/rust-bindings/rust/src/auto/repo.rs @@ -900,6 +900,34 @@ impl Repo { // unsafe { TODO: call ostree_sys:ostree_repo_write_metadata() } //} + //pub fn write_metadata_async, Q: FnOnce(Result) + Send + 'static>(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant, cancellable: Option<&P>, callback: Q) { + // unsafe { TODO: call ostree_sys:ostree_repo_write_metadata_async() } + //} + + //#[cfg(feature = "futures")] + //pub fn write_metadata_async_future(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant) -> Box_> + std::marker::Unpin> { + //use gio::GioFuture; + //use fragile::Fragile; + + //let expected_checksum = expected_checksum.map(ToOwned::to_owned); + //let object = object.clone(); + //GioFuture::new(self, move |obj, send| { + // let cancellable = gio::Cancellable::new(); + // let send = Fragile::new(send); + // obj.write_metadata_async( + // objtype, + // expected_checksum.as_ref().map(::std::borrow::Borrow::borrow), + // &object, + // Some(&cancellable), + // move |res| { + // let _ = send.into_inner().send(res); + // }, + // ); + + // cancellable + //}) + //} + pub fn write_metadata_stream_trusted, Q: IsA>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Option<&Q>) -> Result<(), Error> { unsafe { let mut error = ptr::null_mut();