// This file was automatically generated by `elaborate`.
// https://github.com/trailofbits/elaborate

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



#[cfg(windows)]
pub trait BorrowedHandleContext {
/// Creates a new `OwnedHandle` instance that shares the same underlying
/// object as the existing `BorrowedHandle` instance.
fn try_clone_to_owned_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: io :: OwnedHandle > );
}
#[cfg(windows)]
impl BorrowedHandleContext for std :: os :: windows :: io :: BorrowedHandle < '_ > {
fn try_clone_to_owned_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: io :: OwnedHandle > ) {
    std :: os :: windows :: io :: BorrowedHandle :: < '_ > :: try_clone_to_owned(self)
        .with_context(|| crate::call_failed!(Some(self), "try_clone_to_owned"))
}
}
#[cfg(windows)]
pub trait BorrowedSocketContext {
/// Creates a new `OwnedSocket` instance that shares the same underlying
/// object as the existing `BorrowedSocket` instance.
fn try_clone_to_owned_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: io :: OwnedSocket > );
}
#[cfg(windows)]
impl BorrowedSocketContext for std :: os :: windows :: io :: BorrowedSocket < '_ > {
fn try_clone_to_owned_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < std :: os :: windows :: io :: OwnedSocket > ) {
    std :: os :: windows :: io :: BorrowedSocket :: < '_ > :: try_clone_to_owned(self)
        .with_context(|| crate::call_failed!(Some(self), "try_clone_to_owned"))
}
}
#[cfg(windows)]
pub trait OwnedHandleContext: Sized {
/// Creates a new `OwnedHandle` instance that shares the same underlying
/// object as the existing `OwnedHandle` instance.
fn try_clone_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > );
}
#[cfg(windows)]
impl OwnedHandleContext for std :: os :: windows :: io :: OwnedHandle {
fn try_clone_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) {
    std :: os :: windows :: io :: OwnedHandle :: try_clone(self)
        .with_context(|| crate::call_failed!(Some(self), "try_clone"))
}
}
#[cfg(windows)]
pub trait OwnedSocketContext: Sized {
/// Creates a new `OwnedSocket` instance that shares the same underlying
/// object as the existing `OwnedSocket` instance.
fn try_clone_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > );
}
#[cfg(windows)]
impl OwnedSocketContext for std :: os :: windows :: io :: OwnedSocket {
fn try_clone_wc ( & self ) -> crate :: rewrite_output_type ! ( std :: io :: Result < Self > ) {
    std :: os :: windows :: io :: OwnedSocket :: try_clone(self)
        .with_context(|| crate::call_failed!(Some(self), "try_clone"))
}
}

