pub enum EnsuredBufferedInput<I>{
AlreadyBuffered(I),
Buffered(BufferedInput<I>),
}Expand description
Input value that is guaranteed to report itself as buffered.
This enum is returned by BufferedInput::ensure. It keeps an input that
already buffers items as-is, and wraps an unbuffered input in
BufferedInput. Operations delegate to the selected branch.
Variants§
AlreadyBuffered(I)
The original input already reported itself as buffered.
Buffered(BufferedInput<I>)
The original input was wrapped in BufferedInput.
Trait Implementations§
Source§impl<I> Input for EnsuredBufferedInput<I>
impl<I> Input for EnsuredBufferedInput<I>
Source§fn is_buffered(&self) -> bool
fn is_buffered(&self) -> bool
Reports that this input is buffered.
Source§unsafe fn read_unchecked(
&mut self,
output: &mut [Self::Item],
index: usize,
count: usize,
) -> Result<usize>
unsafe fn read_unchecked( &mut self, output: &mut [Self::Item], index: usize, count: usize, ) -> Result<usize>
Reads items from the selected input branch.
Source§fn read(&mut self, output: &mut [Self::Item]) -> Result<usize>
fn read(&mut self, output: &mut [Self::Item]) -> Result<usize>
Reads items into the full output slice.
Source§unsafe fn read_fully_unchecked(
&mut self,
output: &mut [Self::Item],
index: usize,
count: usize,
) -> Result<usize>
unsafe fn read_fully_unchecked( &mut self, output: &mut [Self::Item], index: usize, count: usize, ) -> Result<usize>
Reads items until the indexed output range is full or EOF is reached.
Source§impl<I> Seekable for EnsuredBufferedInput<I>
impl<I> Seekable for EnsuredBufferedInput<I>
Auto Trait Implementations§
impl<I> Freeze for EnsuredBufferedInput<I>
impl<I> RefUnwindSafe for EnsuredBufferedInput<I>
impl<I> Send for EnsuredBufferedInput<I>
impl<I> Sync for EnsuredBufferedInput<I>
impl<I> Unpin for EnsuredBufferedInput<I>
impl<I> UnsafeUnpin for EnsuredBufferedInput<I>
impl<I> UnwindSafe for EnsuredBufferedInput<I>
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