[−][src]Struct wslapi::Stdio
A WslLaunch stdin, stdout, or stderr parameter
Implementations
impl Stdio
[src]
pub fn null() -> Self
[src]
This stream will be ignored. This is the equivalent of attaching the stream to /dev/null
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self>
[src]
Stream data from a temporary file containing the contents of bytes
pub fn from_file(file: File) -> Result<Self>
[src]
Stream data from or into a file handle
pub unsafe fn from_handle(handle: HANDLE) -> Self
[src]
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
pub unsafe fn from_as_raw_handle(owner: impl AsRawHandle + 'static) -> Self
[src]
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
pub fn as_raw_handle(&self) -> RawHandle
[src]
pub fn as_winapi_handle(&self) -> HANDLE
[src]
Get a winapi::shared::ntdef::HANDLE
Trait Implementations
impl AsRawHandle for Stdio
[src]
fn as_raw_handle(&self) -> RawHandle
[src]
impl From<()> for Stdio
[src]
impl<'_> TryFrom<&'_ [u8]> for Stdio
[src]
fn try_from(value: &[u8]) -> Result<Self>
[src]
type Error = Error
The type returned in the event of a conversion error.
impl<'_> TryFrom<&'_ str> for Stdio
[src]
fn try_from(value: &str) -> Result<Self>
[src]
type Error = Error
The type returned in the event of a conversion error.
impl TryFrom<File> for Stdio
[src]
fn try_from(value: File) -> Result<Self>
[src]
type Error = Error
The type returned in the event of a conversion error.
impl TryFrom<String> for Stdio
[src]
fn try_from(value: String) -> Result<Self>
[src]
type Error = Error
The type returned in the event of a conversion error.
impl TryFrom<Vec<u8>> for Stdio
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Stdio
impl !Send for Stdio
impl !Sync for Stdio
impl Unpin for Stdio
impl !UnwindSafe for Stdio
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,