Skip to main content

EnsuredBufferedOutput

Enum EnsuredBufferedOutput 

Source
pub enum EnsuredBufferedOutput<O>
where O: Output, O::Item: Copy + Default,
{ AlreadyBuffered(O), Buffered(BufferedOutput<O>), }
Expand description

Output value that is guaranteed to report itself as buffered.

This enum is returned by BufferedOutput::ensure. It keeps an output that already buffers items as-is, and wraps an unbuffered output in BufferedOutput. Operations delegate to the selected branch.

Variants§

§

AlreadyBuffered(O)

The original output already reported itself as buffered.

§

Buffered(BufferedOutput<O>)

The original output was wrapped in BufferedOutput.

Trait Implementations§

Source§

impl<O> Output for EnsuredBufferedOutput<O>
where O: Output, O::Item: Copy + Default,

Source§

fn is_buffered(&self) -> bool

Reports that this output is buffered.

Source§

unsafe fn write_unchecked( &mut self, input: &[Self::Item], index: usize, count: usize, ) -> Result<usize>

Writes items through the selected output branch.

Source§

fn write(&mut self, input: &[Self::Item]) -> Result<usize>

Writes items from the full input slice.

Source§

unsafe fn write_fully_unchecked( &mut self, input: &[Self::Item], index: usize, count: usize, ) -> Result<()>

Writes all items from an indexed input range.

Source§

fn write_fully(&mut self, input: &[Self::Item]) -> Result<()>

Writes all items from the full input slice.

Source§

fn flush(&mut self) -> Result<()>

Flushes pending items through the selected output branch.

Source§

type Item = <O as Output>::Item

The item type written to this output.
Source§

impl<O> Seekable for EnsuredBufferedOutput<O>
where O: SeekableOutput, <O as Output>::Item: Copy + Default,

Source§

fn seek_to(&mut self, position: SeekFrom) -> Result<u64>

Seeks in item offsets through the selected output branch.

Source§

type Unit = <O as Output>::Item

The unit type used to measure seek positions and offsets.

Auto Trait Implementations§

§

impl<O> Freeze for EnsuredBufferedOutput<O>
where <O as Output>::Item: Sized, O: Freeze,

§

impl<O> RefUnwindSafe for EnsuredBufferedOutput<O>

§

impl<O> Send for EnsuredBufferedOutput<O>
where <O as Output>::Item: Sized + Send, O: Send,

§

impl<O> Sync for EnsuredBufferedOutput<O>
where <O as Output>::Item: Sized + Sync, O: Sync,

§

impl<O> Unpin for EnsuredBufferedOutput<O>
where <O as Output>::Item: Sized + Unpin, O: Unpin,

§

impl<O> UnsafeUnpin for EnsuredBufferedOutput<O>
where <O as Output>::Item: Sized, O: UnsafeUnpin,

§

impl<O> UnwindSafe for EnsuredBufferedOutput<O>
where <O as Output>::Item: Sized + UnwindSafe, O: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SeekableOutput for T
where T: Output + Seekable<Unit = <T as Output>::Item>,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.