| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#; |
| 2 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::{Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#, Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#}; |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::ManuallyDroprust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/manually_drop/ManuallyDrop#; |
| 4 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::osrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/::unixrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/unix/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/unix/io/::{AsFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/AsFd#, AsRawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/AsRawFd#, BorrowedFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/BorrowedFd#, FromRawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/FromRawFd#, RawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/RawFd#}; |
| 5 | |
| 6 | /// Unix handle to an open terminal. |
| 7 | pub enum Terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal# { |
| 8 | /// Non-owning file for one of the standard I/O streams. |
| 9 | Stdiorust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#Stdio#(ManuallyDroprust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/manually_drop/ManuallyDrop#<Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#>), |
| 10 | |
| 11 | /// Owned file for `/dev/tty`. |
| 12 | Filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#File#(Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#), |
| 13 | } |
| 14 | |
| 15 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 16 | pub struct TerminalModerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode# { |
| 17 | termiosrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#termios.: libcrust-analyzer cargo libc 0.2.147 crate/::termiosrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/termios#, |
| 18 | } |
| 19 | |
| 20 | impl Terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal# { |
| 21 | pub fn openrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]open().() -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<Selfrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]> { |
| 22 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(terminal) = open_fd_terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/open_fd_terminal().(2) { |
| 23 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(terminal) |
| 24 | } else if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(terminal) = open_fd_terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/open_fd_terminal().(0) { |
| 25 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(terminal) |
| 26 | } else if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(terminal) = open_fd_terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/open_fd_terminal().(1) { |
| 27 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(terminal) |
| 28 | } else { |
| 29 | let file = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::OpenOptionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/OpenOptions#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[OpenOptions]new().() |
| 30 | .readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[OpenOptions]read().(true) |
| 31 | .writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[OpenOptions]write().(true) |
| 32 | .openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[OpenOptions]open().("/dev/tty")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 33 | if is_terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/is_terminal().(file.as_fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/impl#[`fs::File`][AsFd]as_fd().()) { |
| 34 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]::Filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#File#(file)) |
| 35 | } else { |
| 36 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::from_raw_os_errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]from_raw_os_error().(libcrust-analyzer cargo libc 0.2.147 crate/::ENOTTYrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/ENOTTY.)) |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | pub fn get_terminal_moderust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]get_terminal_mode().(&self) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<TerminalModerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#> { |
| 42 | unsafe { |
| 43 | let mut termios = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::zeroedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/zeroed().(); |
| 44 | check_retrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/check_ret().(libcrust-analyzer cargo libc 0.2.147 crate/::tcgetattrrust-analyzer cargo libc 0.2.147 tcgetattr().(self.as_fdrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][AsFd]as_fd().().as_raw_fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/impl#[`BorrowedFd<'_>`][AsRawFd]as_raw_fd().(), &mut termios))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 45 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(TerminalModerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode# { termiosrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#termios. }) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | pub fn set_terminal_moderust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]set_terminal_mode().(&self, mode: &TerminalModerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 50 | unsafe { |
| 51 | check_retrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/check_ret().(libcrust-analyzer cargo libc 0.2.147 crate/::tcsetattrrust-analyzer cargo libc 0.2.147 tcsetattr().( |
| 52 | self.as_fdrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][AsFd]as_fd().().as_raw_fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/impl#[`BorrowedFd<'_>`][AsRawFd]as_raw_fd().(), |
| 53 | libcrust-analyzer cargo libc 0.2.147 crate/::TCSANOWrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/b64/x86_64/TCSANOW., |
| 54 | &mode.termiosrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#termios., |
| 55 | ))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 56 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | fn as_filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]as_file().(&self) -> &Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File# { |
| 61 | match self { |
| 62 | Selfrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]::Stdiorust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#Stdio#(io) => io, |
| 63 | Selfrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]::Filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#File#(io) => io, |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | fn open_fd_terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/open_fd_terminal().(fd: RawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/RawFd#) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#> { |
| 69 | let file = unsafe { ManuallyDroprust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/manually_drop/ManuallyDrop#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/manually_drop/impl#[`ManuallyDrop<T>`]new().(Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::from_raw_fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/impl#[`fs::File`][FromRawFd]from_raw_fd().(fd)) }; |
| 70 | if is_terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/is_terminal().(file.as_fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/impl#[`fs::File`][AsFd]as_fd().()) { |
| 71 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#::Stdiorust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#Stdio#(file)) |
| 72 | } else { |
| 73 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | impl TerminalModerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode# { |
| 78 | pub fn enable_line_editingrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[TerminalMode]enable_line_editing().(&mut self) { |
| 79 | self.termiosrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#termios..c_lflagrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/termios#c_lflag. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOrAssign<Self>`]bitor_assign().libcrust-analyzer cargo libc 0.2.147 crate/::ICANONrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/b64/x86_64/ICANON.; |
| 80 | } |
| 81 | |
| 82 | pub fn disable_echorust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[TerminalMode]disable_echo().(&mut self) { |
| 83 | self.termiosrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#termios..c_lflagrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/termios#c_lflag. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAndAssign<Self>`]bitand_assign().&=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAndAssign<Self>`]bitand_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAndAssign<Self>`]bitand_assign().!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][Not]not().libcrust-analyzer cargo libc 0.2.147 crate/::ECHOrust-analyzer cargo libc 0.2.147 unix/linux_like/ECHO.; |
| 84 | self.termiosrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#termios..c_lflagrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/termios#c_lflag. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAndAssign<Self>`]bitand_assign().&=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAndAssign<Self>`]bitand_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAndAssign<Self>`]bitand_assign().!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][Not]not().libcrust-analyzer cargo libc 0.2.147 crate/::ICANONrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/b64/x86_64/ICANON.; |
| 85 | } |
| 86 | |
| 87 | pub fn enable_echorust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[TerminalMode]enable_echo().(&mut self) { |
| 88 | self.termiosrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#termios..c_lflagrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/termios#c_lflag. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOrAssign<Self>`]bitor_assign().libcrust-analyzer cargo libc 0.2.147 crate/::ECHOrust-analyzer cargo libc 0.2.147 unix/linux_like/ECHO.; |
| 89 | self.termiosrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#termios..c_lflagrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/termios#c_lflag. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOrAssign<Self>`]bitor_assign().!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][Not]not().libcrust-analyzer cargo libc 0.2.147 crate/::ICANONrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/b64/x86_64/ICANON.; |
| 90 | } |
| 91 | |
| 92 | pub fn is_echo_enabledrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[TerminalMode]is_echo_enabled().(&self) -> bool { |
| 93 | self.termiosrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/TerminalMode#termios..c_lflagrust-analyzer cargo libc 0.2.147 unix/linux_like/linux/gnu/termios#c_lflag. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().libcrust-analyzer cargo libc 0.2.147 crate/::ECHOrust-analyzer cargo libc 0.2.147 unix/linux_like/ECHO. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialEq<Self>`]ne().0 |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | fn is_terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/is_terminal().(fd: BorrowedFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/BorrowedFd#) -> bool { |
| 98 | unsafe { |
| 99 | libcrust-analyzer cargo libc 0.2.147 crate/::isattyrust-analyzer cargo libc 0.2.147 isatty().(fd.as_raw_fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/impl#[`BorrowedFd<'_>`][AsRawFd]as_raw_fd().()) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().1 |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | fn check_retrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/check_ret().(input: i32) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 104 | if input rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().0 { |
| 105 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 106 | } else { |
| 107 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::last_os_errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]last_os_error().()) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | impl AsFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/AsFd# for Terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal# { |
| 112 | fn as_fdrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][AsFd]as_fd().(&self) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::osrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/::fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/::BorrowedFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/BorrowedFd#<'_> { |
| 113 | match self { |
| 114 | Selfrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][AsFd]::Stdiorust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#Stdio#(stdin) => stdin.as_fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/impl#[`fs::File`][AsFd]as_fd().(), |
| 115 | Selfrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][AsFd]::Filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal#File#(file) => file.as_fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/owned/impl#[`fs::File`][AsFd]as_fd().(), |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | impl Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read# for Terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal# { |
| 121 | fn readrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][Read]read().(&mut self, buf: &mut [u8]) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize> { |
| 122 | self.as_filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]as_file().().readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[`&File`][Read]read().(buf) |
| 123 | } |
| 124 | |
| 125 | fn read_vectoredrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][Read]read_vectored().(&mut self, bufs: &mut [stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::IoSliceMutrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/IoSliceMut#<'_>]) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize> { |
| 126 | self.as_filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]as_file().().read_vectoredrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[`&File`][Read]read_vectored().(bufs) |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | impl Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write# for Terminalrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/Terminal# { |
| 131 | fn writerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][Write]write().(&mut self, buf: &[u8]) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize> { |
| 132 | self.as_filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]as_file().().writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[`&File`][Write]write().(buf) |
| 133 | } |
| 134 | |
| 135 | fn flushrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][Write]flush().(&mut self) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 136 | self.as_filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]as_file().().flushrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[`&File`][Write]flush().() |
| 137 | } |
| 138 | |
| 139 | fn write_vectoredrust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal][Write]write_vectored().(&mut self, bufs: &[stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::IoSlicerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/IoSlice#<'_>]) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize> { |
| 140 | self.as_filerust-analyzer cargo terminal-prompt 0.2.3 sys/unix/impl#[Terminal]as_file().().write_vectoredrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[`&File`][Write]write_vectored().(bufs) |
| 141 | } |
| 142 | } |