Struct WindowsProcessSpawner
pub struct WindowsProcessSpawner<A = DefaultWindowsApi>where
A: WindowsApi,{
api: Arc<A>,
}Expand description
Process spawner backed by WindowsApi::create_process_with_os_args.
Holds an Arc over a WindowsApi implementation so callers can
inject a mock in tests (the crate’s mock feature exposes
MockWindowsApi for this purpose); production code uses
Self::default which selects DefaultWindowsApi.
Fields§
§api: Arc<A>Implementations§
Source§impl<A> WindowsProcessSpawner<A>where
A: WindowsApi,
impl<A> WindowsProcessSpawner<A>where
A: WindowsApi,
Sourcepub fn new(api: Arc<A>) -> WindowsProcessSpawner<A>
pub fn new(api: Arc<A>) -> WindowsProcessSpawner<A>
Construct a spawner around a specific WindowsApi implementation.
§Arguments
api- Windows API operations implementation.
Trait Implementations§
Source§impl Default for WindowsProcessSpawner
impl Default for WindowsProcessSpawner
Source§fn default() -> WindowsProcessSpawner
fn default() -> WindowsProcessSpawner
Returns the “default value” for a type. Read more
Source§impl<A> ProcessSpawner for WindowsProcessSpawner<A>where
A: WindowsApi + 'static,
impl<A> ProcessSpawner for WindowsProcessSpawner<A>where
A: WindowsApi + 'static,
Source§type Context = WindowsLaunchContext
type Context = WindowsLaunchContext
Per-spawn context type; see
LaunchContext.Source§type Handle = SendProcessInformation
type Handle = SendProcessInformation
Opaque handle to a successfully spawned child. Read more
Source§fn spawn(
&self,
program: &OsStr,
args: &[OsString],
context: &<WindowsProcessSpawner<A> as ProcessSpawner>::Context,
) -> Result<<WindowsProcessSpawner<A> as ProcessSpawner>::Handle, <WindowsProcessSpawner<A> as ProcessSpawner>::Error>
fn spawn( &self, program: &OsStr, args: &[OsString], context: &<WindowsProcessSpawner<A> as ProcessSpawner>::Context, ) -> Result<<WindowsProcessSpawner<A> as ProcessSpawner>::Handle, <WindowsProcessSpawner<A> as ProcessSpawner>::Error>
Auto Trait Implementations§
impl<A> Freeze for WindowsProcessSpawner<A>
impl<A> RefUnwindSafe for WindowsProcessSpawner<A>where
A: RefUnwindSafe,
impl<A> Send for WindowsProcessSpawner<A>
impl<A> Sync for WindowsProcessSpawner<A>
impl<A> Unpin for WindowsProcessSpawner<A>
impl<A> UnsafeUnpin for WindowsProcessSpawner<A>
impl<A> UnwindSafe for WindowsProcessSpawner<A>where
A: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more