pub struct StdinOverride;Expand description
Override the File Descriptor safely. For more information please see the module-level documentation
Implementations§
Source§impl StdinOverride
impl StdinOverride
Sourcepub fn override_file<P: AsRef<Path>>(p: P) -> Result<StdinOverrideGuard>
pub fn override_file<P: AsRef<Path>>(p: P) -> Result<StdinOverrideGuard>
Override the File Descriptor by providing a path.
This uses OpenOptions with create(true) so it will fail/succeed accordingly.
(won’t fail if the fail already exists and will create it if it doesn’t exist.)
Sourcepub fn override_raw<FD: AsRawFd>(fd: FD) -> Result<StdinOverrideGuard>
pub fn override_raw<FD: AsRawFd>(fd: FD) -> Result<StdinOverrideGuard>
Override the File Descriptor by providing something that can be turned into a file descriptor.
This will accept Sockets, Files, and even Stdio’s. AsRawFd
Auto Trait Implementations§
impl Freeze for StdinOverride
impl RefUnwindSafe for StdinOverride
impl Send for StdinOverride
impl Sync for StdinOverride
impl Unpin for StdinOverride
impl UnwindSafe for StdinOverride
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