raw_stdpipes 1.0.0

Raw handles to the standard terminal pipes.
Documentation
//! Raw handles to the standard terminal pipes.

use std::fs::File;

#[cfg(target_family = "unix")]
#[path = "unix.rs"]
mod imp;

#[cfg(target_os = "windows")]
#[path = "windows.rs"]
mod imp;

/// Raw handle to the standard output in [`File`] form,all bytes written are displayed in the terminal.
/// 
/// # Safety
/// 
/// The ownership of the stdout it's effectively transferred to the returned [`File`],making unsafe using
/// macros as [`print!`], [`println!`] or anything else that prints to the standard output.
pub unsafe fn raw_stdout() -> File {
    imp::raw_stdout()
}

/// Raw handle to the standard error in [`File`] form,all bytes written are displayed in the terminal.
/// 
/// # Safety
/// 
/// The ownership of the stdout it's effectively transferred to the returned [`File`],making unsafe using
/// macros as [`eprint!`], [`eprintln!`] or anything else that prints to the standard error.
pub unsafe fn raw_stderr() -> File {
    imp::raw_stderr()
}

/// Raw handle to the standard input in [`File`] form,all bytes readed come from input in the terminal.
/// 
/// # Safety
/// 
/// The ownership of the stdin it's effectively transferred to the returned [`File`],making unsafe using
/// functions as [`io::stdin`] or anything that reads from the standard input.
pub unsafe fn raw_stdin() -> File {
    imp::raw_stdin()
}