Add more documentation for --features=v2021_3

My previous pass was at the default feature level.
This commit is contained in:
Colin Walters 2021-08-03 15:01:10 -04:00
parent 83c829eaad
commit abec2a9e34
6 changed files with 38 additions and 0 deletions

View File

@ -110,6 +110,7 @@ pub fn checksum_file_from_input<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellabl
}
}
/// Compute the OSTree checksum of a file.
#[cfg(any(feature = "v2017_13", feature = "dox"))]
pub fn checksum_file_at<P: IsA<gio::Cancellable>>(
dfd: i32,

View File

@ -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<ffi::OstreeKernelArgs>);
@ -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<P: IsA<gio::Cancellable>>(
&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<GString> {
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<GString> {
unsafe {
@ -177,6 +192,7 @@ impl KernelArgs {
// Not needed
//pub fn cleanup(loc: /*Unimplemented*/Option<Fundamental: Pointer>)
/// 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()) }

View File

@ -92,6 +92,7 @@ impl Repo {
}
}
/// List refs with extended options.
#[cfg(any(feature = "v2016_4", feature = "dox"))]
pub fn list_refs_ext<P: IsA<gio::Cancellable>>(
&self,

View File

@ -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<PathBuf>,
/// A cache from device, inode pairs to checksums.
pub devino_to_csum_cache: Option<RepoDevInoCache>,
/// 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<RepoCheckoutFilter>,
/// SELinux policy.
#[cfg(any(feature = "v2017_6", feature = "dox"))]
pub sepolicy: Option<SePolicy>,
/// When computing security contexts, prefix the path with this value.
pub sepolicy_prefix: Option<String>,
}

View File

@ -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]>,
}

View File

@ -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,
}