diff --git a/rust-bindings/rust/src/functions.rs b/rust-bindings/rust/src/functions.rs index a30ea7bf..053f0c57 100644 --- a/rust-bindings/rust/src/functions.rs +++ b/rust-bindings/rust/src/functions.rs @@ -110,6 +110,7 @@ pub fn checksum_file_from_input, Q: IsA>( dfd: i32, diff --git a/rust-bindings/rust/src/kernel_args.rs b/rust-bindings/rust/src/kernel_args.rs index cca5bc88..94b41771 100644 --- a/rust-bindings/rust/src/kernel_args.rs +++ b/rust-bindings/rust/src/kernel_args.rs @@ -10,6 +10,7 @@ use std::fmt; use std::ptr; glib::wrapper! { + /// Kernel arguments. #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct KernelArgs(Boxed); @@ -20,6 +21,7 @@ glib::wrapper! { } impl KernelArgs { + /// Add a kernel argument. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn append(&mut self, arg: &str) { unsafe { @@ -27,6 +29,7 @@ impl KernelArgs { } } + /// Add multiple kernel arguments. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn append_argv(&mut self, argv: &[&str]) { unsafe { @@ -34,6 +37,7 @@ impl KernelArgs { } } + /// Appends each argument that does not have one of `prefixes`. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn append_argv_filtered(&mut self, argv: &[&str], prefixes: &[&str]) { unsafe { @@ -45,6 +49,7 @@ impl KernelArgs { } } + /// Append the entire contents of the currently booted kernel commandline. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn append_proc_cmdline>( &mut self, @@ -65,6 +70,7 @@ impl KernelArgs { } } + /// Remove a kernel argument. pub fn delete(&mut self, arg: &str) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); @@ -81,6 +87,7 @@ impl KernelArgs { } } + /// Remove a kernel argument. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn delete_key_entry(&mut self, key: &str) -> Result<(), glib::Error> { unsafe { @@ -98,6 +105,7 @@ impl KernelArgs { } } + /// Given `foo`, return the last the value of a `foo=bar` key as `bar`. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn get_last_value(&self, key: &str) -> Option { unsafe { @@ -108,6 +116,7 @@ impl KernelArgs { } } + /// Replace any existing `foo=bar` with `foo=other` e.g. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn new_replace(&mut self, arg: &str) -> Result<(), glib::Error> { unsafe { @@ -125,6 +134,7 @@ impl KernelArgs { } } + /// Append from a whitespace-separated string. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn parse_append(&mut self, options: &str) { unsafe { @@ -135,6 +145,7 @@ impl KernelArgs { } } + /// Replace a kernel argument. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn replace(&mut self, arg: &str) { unsafe { @@ -142,6 +153,7 @@ impl KernelArgs { } } + /// Replace multiple kernel arguments. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn replace_argv(&mut self, argv: &[&str]) { unsafe { @@ -149,6 +161,7 @@ impl KernelArgs { } } + /// A duplicate of `replace`. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn replace_take(&mut self, arg: &str) { unsafe { @@ -156,6 +169,7 @@ impl KernelArgs { } } + /// Convert the kernel arguments to a string. #[cfg(any(feature = "v2019_3", feature = "dox"))] fn to_gstring(&self) -> GString { unsafe { @@ -165,6 +179,7 @@ impl KernelArgs { } } + /// Convert the kernel arguments to a string array. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn to_strv(&self) -> Vec { unsafe { @@ -177,6 +192,7 @@ impl KernelArgs { // Not needed //pub fn cleanup(loc: /*Unimplemented*/Option) + /// Parse the given string as kernel arguments. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn from_string(options: &str) -> KernelArgs { unsafe { @@ -186,6 +202,7 @@ impl KernelArgs { } } + /// Create new empty kernel arguments. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn new() -> KernelArgs { unsafe { from_glib_full(ffi::ostree_kernel_args_new()) } diff --git a/rust-bindings/rust/src/repo.rs b/rust-bindings/rust/src/repo.rs index ba5ab14f..3f9434ae 100644 --- a/rust-bindings/rust/src/repo.rs +++ b/rust-bindings/rust/src/repo.rs @@ -92,6 +92,7 @@ impl Repo { } } + /// List refs with extended options. #[cfg(any(feature = "v2016_4", feature = "dox"))] pub fn list_refs_ext>( &self, diff --git a/rust-bindings/rust/src/repo_checkout_at_options/mod.rs b/rust-bindings/rust/src/repo_checkout_at_options/mod.rs index 30ac8cf6..d7569131 100644 --- a/rust-bindings/rust/src/repo_checkout_at_options/mod.rs +++ b/rust-bindings/rust/src/repo_checkout_at_options/mod.rs @@ -8,20 +8,32 @@ mod repo_checkout_filter; #[cfg(any(feature = "v2018_2", feature = "dox"))] pub use self::repo_checkout_filter::RepoCheckoutFilter; +/// Options for checking out an OSTree commit. pub struct RepoCheckoutAtOptions { + /// Checkout mode. pub mode: RepoCheckoutMode, + /// Overwrite mode. pub overwrite_mode: RepoCheckoutOverwriteMode, + /// Deprecated, do not use. pub enable_uncompressed_cache: bool, + /// Perform `fsync()` on checked out files and directories. pub enable_fsync: bool, + /// Handle OCI/Docker style whiteout files. pub process_whiteouts: bool, + /// Require hardlinking. pub no_copy_fallback: bool, + /// Never hardlink; reflink if possible, otherwise full physical copy. #[cfg(any(feature = "v2017_6", feature = "dox"))] pub force_copy: bool, + /// Suppress mode bits outside of 0775 for directories. #[cfg(any(feature = "v2017_7", feature = "dox"))] pub bareuseronly_dirs: bool, + /// Copy zero-sized files rather than hardlinking. #[cfg(any(feature = "v2018_9", feature = "dox"))] pub force_copy_zerosized: bool, + /// Only check out this subpath. pub subpath: Option, + /// A cache from device, inode pairs to checksums. pub devino_to_csum_cache: Option, /// A callback function to decide which files and directories will be checked out from the /// repo. See the documentation on [RepoCheckoutFilter](struct.RepoCheckoutFilter.html) for more @@ -34,8 +46,10 @@ pub struct RepoCheckoutAtOptions { /// callback to catch and silence any panics that occur. #[cfg(any(feature = "v2018_2", feature = "dox"))] pub filter: Option, + /// SELinux policy. #[cfg(any(feature = "v2017_6", feature = "dox"))] pub sepolicy: Option, + /// When computing security contexts, prefix the path with this value. pub sepolicy_prefix: Option, } diff --git a/rust-bindings/rust/src/sysroot_deploy_tree_opts.rs b/rust-bindings/rust/src/sysroot_deploy_tree_opts.rs index b797cc68..62376f76 100644 --- a/rust-bindings/rust/src/sysroot_deploy_tree_opts.rs +++ b/rust-bindings/rust/src/sysroot_deploy_tree_opts.rs @@ -2,8 +2,11 @@ use ffi::OstreeSysrootDeployTreeOpts; use glib::translate::*; use libc::c_char; +/// Options for deploying an ostree commit. pub struct SysrootDeployTreeOpts<'a> { + /// Use these kernel arguments. pub override_kernel_argv: Option<&'a [&'a str]>, + /// Paths to initramfs files to overlay. pub overlay_initrds: Option<&'a [&'a str]>, } diff --git a/rust-bindings/rust/src/sysroot_write_deployments_opts.rs b/rust-bindings/rust/src/sysroot_write_deployments_opts.rs index 9d2e024b..8c910160 100644 --- a/rust-bindings/rust/src/sysroot_write_deployments_opts.rs +++ b/rust-bindings/rust/src/sysroot_write_deployments_opts.rs @@ -1,7 +1,9 @@ use ffi::OstreeSysrootWriteDeploymentsOpts; use glib::translate::*; +/// Options for writing a deployment. pub struct SysrootWriteDeploymentsOpts { + /// Perform cleanup after writing the deployment. pub do_postclean: bool, }