pub struct In<B: BufRead> { /* private fields */ }Expand description
General Input (stdin, file, socket, etc.).
Implementations§
Source§impl<B: BufRead> In<B>
impl<B: BufRead> In<B>
Sourcepub fn is_empty(&mut self) -> bool
pub fn is_empty(&mut self) -> bool
Returns true if the input stream has more data, returns false otherwise.
Sourcepub fn read_int<T>(&mut self) -> Result<T>
pub fn read_int<T>(&mut self) -> Result<T>
Reads an integer from the input stream.
The integer type is one of i8, i16, i32, i64, i128, isize, u8, u16, u32,
u64, u128, or usize.
§Errors
Same as Scanner::next_int.
Sourcepub fn read_float<T>(&mut self) -> Result<T>
pub fn read_float<T>(&mut self) -> Result<T>
Reads a floating point number from the input stream.
The integer type is one of f32 or f64.
§Errors
Same as Scanner::next_float.
Sourcepub fn read_all_ints<T>(&mut self) -> Result<Vec<T>>
pub fn read_all_ints<T>(&mut self) -> Result<Vec<T>>
Reads all integers from the input stream using the internal scanner, consuming all the content in the input stream, reading the content in a token-by-token streaming mode.
§Errors
Same as Scanner::next_int.
Sourcepub fn read_string(&mut self) -> Result<String>
pub fn read_string(&mut self) -> Result<String>
Auto Trait Implementations§
impl<B> Freeze for In<B>where
B: Freeze,
impl<B> RefUnwindSafe for In<B>where
B: RefUnwindSafe,
impl<B> Send for In<B>where
B: Send,
impl<B> Sync for In<B>where
B: Sync,
impl<B> Unpin for In<B>where
B: Unpin,
impl<B> UnwindSafe for In<B>where
B: UnwindSafe,
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