pub struct WindowedInfinity<'a> { /* private fields */ }Expand description
A WindowedInfinity represents an infinite writable space. A small section of it is mapped to a &mut u8 to which writes are forwarded; writes to the area outside only advance a cursor.
Implementations§
Source§impl<'a> WindowedInfinity<'a>
impl<'a> WindowedInfinity<'a>
Sourcepub fn new(view: &'a mut [u8], cursor: isize) -> Self
pub fn new(view: &'a mut [u8], cursor: isize) -> Self
Create a new infinity with the window passed as view. The cursor parameter indicates where (in the index space of the view) the infinity’s write operations should start, and is typically either 0 or negative.
Sourcepub fn cursor(&self) -> isize
pub fn cursor(&self) -> isize
Report the current write cursor position in the index space of the view.
This typically used at the end of an infinity’s life time to see whether the view needs to be truncated before further processing, and whether there was any data discarded after the view.
Trait Implementations§
Source§impl ErrorType for WindowedInfinity<'_>
impl ErrorType for WindowedInfinity<'_>
Source§type Error = Infallible
type Error = Infallible
Error type of all the IO operations on this type.
Source§impl Write for WindowedInfinity<'_>
impl Write for WindowedInfinity<'_>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Auto Trait Implementations§
impl<'a> Freeze for WindowedInfinity<'a>
impl<'a> RefUnwindSafe for WindowedInfinity<'a>
impl<'a> Send for WindowedInfinity<'a>
impl<'a> Sync for WindowedInfinity<'a>
impl<'a> Unpin for WindowedInfinity<'a>
impl<'a> !UnwindSafe for WindowedInfinity<'a>
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