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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.