pub struct Stdio { /* private fields */ }
Expand description
A WslLaunch stdin, stdout, or stderr parameter
Implementations§
Source§impl Stdio
impl Stdio
Sourcepub fn null() -> Self
pub fn null() -> Self
This stream will be ignored. This is the equivalent of attaching the stream to /dev/null
Sourcepub fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self>
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self>
Stream data from a temporary file containing the contents of bytes
Sourcepub unsafe fn from_handle(handle: HANDLE) -> Self
pub unsafe fn from_handle(handle: HANDLE) -> Self
Take ownership of a raw handle
§Safety
handle
is assumed to be “valid”. That is:
- CloseHandle(handle) must be sound when Stdio is Dropped
- WslLaunch(…, handle, …) must be legal for stdIn, stdOut, or stdErr
- The handle must be inheritable without CreateProcess’s
bInheritHandles
=TRUE
NULL
is also legal
Sourcepub unsafe fn from_as_raw_handle(owner: impl AsRawHandle + 'static) -> Self
pub unsafe fn from_as_raw_handle(owner: impl AsRawHandle + 'static) -> Self
Take ownership of something with a raw handle
§Safety
owner.as_raw_handle()
is assumed to be “valid”. That is:
- WslLaunch(…, owner.as_raw_handle(), …) must be legal for stdIn, stdOut, or stdErr
- The handle must be inheritable without CreateProcess’s
bInheritHandles
=TRUE
Sourcepub fn as_raw_handle(&self) -> RawHandle
pub fn as_raw_handle(&self) -> RawHandle
Sourcepub fn as_winapi_handle(&self) -> HANDLE
pub fn as_winapi_handle(&self) -> HANDLE
Get a winapi::shared::ntdef::HANDLE
Trait Implementations§
Source§impl AsRawHandle for Stdio
impl AsRawHandle for Stdio
Source§fn as_raw_handle(&self) -> RawHandle
fn as_raw_handle(&self) -> RawHandle
Extracts the raw handle. Read more
Auto Trait Implementations§
impl Freeze for Stdio
impl !RefUnwindSafe for Stdio
impl !Send for Stdio
impl !Sync for Stdio
impl Unpin for Stdio
impl !UnwindSafe for Stdio
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