diff --git a/rust-bindings/rust/conf/ostree.toml b/rust-bindings/rust/conf/ostree.toml index 775e8ee7..aeb7734a 100644 --- a/rust-bindings/rust/conf/ostree.toml +++ b/rust-bindings/rust/conf/ostree.toml @@ -139,8 +139,8 @@ status = "generate" name = "OSTree.Repo" status = "generate" [[object.function]] - # [FAIL] this one generates a guchar** incorrectly - name = "write_content_async" + # [MANUAL] we special-case the checksum value + pattern = "write_content|write_content_async|write_metadata|write_metadata_async" ignore = true [[object.function]] diff --git a/rust-bindings/rust/src/auto/repo.rs b/rust-bindings/rust/src/auto/repo.rs index ed5ff42a..7e37a713 100644 --- a/rust-bindings/rust/src/auto/repo.rs +++ b/rust-bindings/rust/src/auto/repo.rs @@ -903,18 +903,6 @@ impl Repo { } } - //pub fn write_content, Q: IsA>(&self, expected_checksum: Option<&str>, object_input: &P, length: u64, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), glib::Error> { - // unsafe { TODO: call ostree_sys:ostree_repo_write_content() } - //} - - pub fn write_content_trusted, Q: IsA>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Option<&Q>) -> Result<(), glib::Error> { - unsafe { - let mut error = ptr::null_mut(); - let _ = ostree_sys::ostree_repo_write_content_trusted(self.to_glib_none().0, checksum.to_glib_none().0, object_input.as_ref().to_glib_none().0, length, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } - } - } - pub fn write_dfd_to_mtree, Q: IsA>(&self, dfd: i32, path: &str, mtree: &P, modifier: Option<&RepoCommitModifier>, cancellable: Option<&Q>) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); @@ -931,51 +919,6 @@ impl Repo { } } - //pub fn write_metadata>(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&P>) -> Result<(), glib::Error> { - // 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() } - //} - - // - //pub fn write_metadata_async_future(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant) -> Pin> + 'static>> { - - //let expected_checksum = expected_checksum.map(ToOwned::to_owned); - //let object = object.clone(); - //Box_::pin(gio::GioFuture::new(self, move |obj, send| { - // let cancellable = gio::Cancellable::new(); - // obj.write_metadata_async( - // objtype, - // expected_checksum.as_ref().map(::std::borrow::Borrow::borrow), - // &object, - // Some(&cancellable), - // move |res| { - // send.resolve(res); - // }, - // ); - - // cancellable - //})) - //} - - pub fn write_metadata_stream_trusted, Q: IsA>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Option<&Q>) -> Result<(), glib::Error> { - unsafe { - let mut error = ptr::null_mut(); - let _ = ostree_sys::ostree_repo_write_metadata_stream_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, object_input.as_ref().to_glib_none().0, length, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } - } - } - - pub fn write_metadata_trusted>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: Option<&P>) -> Result<(), glib::Error> { - unsafe { - let mut error = ptr::null_mut(); - let _ = ostree_sys::ostree_repo_write_metadata_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, variant.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } - } - } - pub fn write_mtree, Q: IsA>(&self, mtree: &P, cancellable: Option<&Q>) -> Result { unsafe { let mut out_file = ptr::null_mut(); diff --git a/rust-bindings/rust/src/auto/versions.txt b/rust-bindings/rust/src/auto/versions.txt index d08ef3b9..518b4e22 100644 --- a/rust-bindings/rust/src/auto/versions.txt +++ b/rust-bindings/rust/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1) -from gir-files (https://github.com/gtk-rs/gir-files @ 7815425) +from gir-files (https://github.com/gtk-rs/gir-files @ 26bb987) diff --git a/rust-bindings/rust/sys/src/auto/versions.txt b/rust-bindings/rust/sys/src/auto/versions.txt index d08ef3b9..518b4e22 100644 --- a/rust-bindings/rust/sys/src/auto/versions.txt +++ b/rust-bindings/rust/sys/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1) -from gir-files (https://github.com/gtk-rs/gir-files @ 7815425) +from gir-files (https://github.com/gtk-rs/gir-files @ 26bb987)