set past end of stream, set Byte to -1, Char and Code to end_of_file, at end of stream (#479)

This commit is contained in:
Mark Thom
2020-05-10 14:50:17 -06:00
parent d170c807e3
commit c1df7ead1a
2 changed files with 67 additions and 1 deletions

View File

@@ -59,7 +59,7 @@ pub enum EOFAction {
Reset,
}
#[derive(Debug)]
#[derive(Debug, PartialEq)]
pub enum AtEndOfStream {
Not,
At,
@@ -328,6 +328,12 @@ impl Stream {
self.stream_inst.0.borrow_mut().0
}
#[inline]
pub(crate)
fn at_end_of_stream(&mut self) -> bool {
self.position_relative_to_end() == AtEndOfStream::At
}
#[inline]
pub(crate)
fn set_past_end_of_stream(&mut self) {