elaborate 1.1.0

Wrappers for standard library functions and types to produce more elaborate error messages
Documentation
// This file was automatically generated by `elaborate`.
// https://github.com/trailofbits/elaborate

#[allow(unused_imports)]
use anyhow::Context;


#[cfg(feature = "windows_process_extensions_raw_attribute")]
#[cfg(windows)]
pub trait CommandExtContext: std :: os :: windows :: process :: CommandExt {
/// Executes the command as a child process with the given
/// [`ProcThreadAttributeList`], returning a handle to it.
/// 
/// This method enables the customization of attributes for the spawned
/// child process on Windows systems.
/// Attributes offer extended configurability for process creation,
/// but their usage can be intricate and potentially unsafe.
/// 
/// # Note
/// 
/// By default, stdin, stdout, and stderr are inherited from the parent
/// process.
/// 
/// # Example
/// 
/// ```
/// #![feature(windows_process_extensions_raw_attribute)]
/// use std::os::windows::io::AsRawHandle;
/// use std::os::windows::process::{CommandExt, ProcThreadAttributeList};
/// use std::process::Command;
/// 
/// # struct ProcessDropGuard(std::process::Child);
/// # impl Drop for ProcessDropGuard {
/// #     fn drop(&mut self) {
/// #         let _ = self.0.kill();
/// #     }
/// # }
/// #
/// let parent = Command::new("cmd").spawn()?;
/// let parent_process_handle = parent.as_raw_handle();
/// # let parent = ProcessDropGuard(parent);
/// 
/// const PROC_THREAD_ATTRIBUTE_PARENT_PROCESS: usize = 0x00020000;
/// let mut attribute_list = ProcThreadAttributeList::build()
///     .attribute(PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, &parent_process_handle)
///     .finish()
///     .unwrap();
/// 
/// let mut child = Command::new("cmd").spawn_with_attributes(&attribute_list)?;
/// #
/// # child.kill()?;
/// # Ok::<(), std::io::Error>(())
/// ```
fn spawn_with_attributes_wc ( & mut self , attribute_list : & std :: os :: windows :: process :: ProcThreadAttributeList < '_ > ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: process :: Child > ) {
    < Self as :: std :: os :: windows :: process :: CommandExt > :: spawn_with_attributes(self, attribute_list)
        .with_context(|| crate::call_failed!(Some(self), "spawn_with_attributes", attribute_list))
}
}

#[cfg(feature = "windows_process_extensions_raw_attribute")]
#[cfg(windows)]
impl<T> CommandExtContext for T where T: std :: os :: windows :: process :: CommandExt {}