Struct borsh::maybestd::io::StdinLock 1.0.0[−][src]
A locked reference to the Stdin
handle.
This handle implements both the Read
and BufRead
traits, and
is constructed via the Stdin::lock
method.
Note: Windows Portability Consideration
When operating in a console, the Windows implementation of this stream does not support non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return an error.
Examples
use std::io::{self, Read}; fn main() -> io::Result<()> { let mut buffer = String::new(); let stdin = io::stdin(); // We get `Stdin` here. { let mut handle = stdin.lock(); // We get `StdinLock` here. handle.read_to_string(&mut buffer)?; } // `StdinLock` is dropped here. Ok(()) }
Trait Implementations
impl<'a> AsRawFd for StdinLock<'a>
1.35.0[src]
impl<'_> BufRead for StdinLock<'_>
[src]
pub fn fill_buf(&mut self) -> Result<&[u8], Error>
[src]
pub fn consume(&mut self, n: usize)
[src]
pub fn read_until(
&mut self,
byte: u8,
buf: &mut Vec<u8, Global>
) -> Result<usize, Error>
[src]
&mut self,
byte: u8,
buf: &mut Vec<u8, Global>
) -> Result<usize, Error>
pub fn read_line(&mut self, buf: &mut String) -> Result<usize, Error>
[src]
pub fn split(self, byte: u8) -> Split<Self>ⓘ
[src]
pub fn lines(self) -> Lines<Self>ⓘ
[src]
impl<'_> Debug for StdinLock<'_>
1.16.0[src]
impl<'_> Read for StdinLock<'_>
[src]
pub fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
[src]
pub fn read_vectored(
&mut self,
bufs: &mut [IoSliceMut<'_>]
) -> Result<usize, Error>
[src]
&mut self,
bufs: &mut [IoSliceMut<'_>]
) -> Result<usize, Error>
pub fn is_read_vectored(&self) -> bool
[src]
pub unsafe fn initializer(&self) -> Initializer
[src]
pub fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
[src]
pub fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
[src]
pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
[src]
pub fn by_ref(&mut self) -> &mut Selfⓘ
[src]
pub fn bytes(self) -> Bytes<Self>ⓘ
[src]
pub fn chain<R>(self, next: R) -> Chain<Self, R>ⓘ where
R: Read,
[src]
R: Read,
pub fn take(self, limit: u64) -> Take<Self>ⓘ
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for StdinLock<'a>
impl<'a> !Send for StdinLock<'a>
impl<'a> Sync for StdinLock<'a>
impl<'a> Unpin for StdinLock<'a>
impl<'a> UnwindSafe for StdinLock<'a>
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>,