Struct CopyingSource

Source
pub struct CopyingSource<S: Source, U: Sink> { /* private fields */ }
Expand description

A source that also copies each read element to the sink

Warning: if a call to write fails, this source will return an error and the element that has been read from the underlying source will be lost

Implementations§

Source§

impl<S: Source, U: Sink> CopyingSource<S, U>

Source

pub fn copy_next(&mut self) -> Result<(), Asn1DerError>

Copies the next element

Source

pub fn copy_n(&mut self, n: usize) -> Result<(), Asn1DerError>

Copies the next n elements

Trait Implementations§

Source§

impl<S: Source, U: Sink> Source for CopyingSource<S, U>

Source§

fn read(&mut self) -> Result<u8, Asn1DerError>

Reads the next element
Source§

fn counting_source(self, ctr: &mut usize) -> CountingSource<'_, Self>

Creates a counting source
Source§

fn copying_source<U: Sink>(self, sink: U) -> CopyingSource<Self, U>

Creates a copying source

Auto Trait Implementations§

§

impl<S, U> Freeze for CopyingSource<S, U>
where S: Freeze, U: Freeze,

§

impl<S, U> RefUnwindSafe for CopyingSource<S, U>

§

impl<S, U> Send for CopyingSource<S, U>
where S: Send, U: Send,

§

impl<S, U> Sync for CopyingSource<S, U>
where S: Sync, U: Sync,

§

impl<S, U> Unpin for CopyingSource<S, U>
where S: Unpin, U: Unpin,

§

impl<S, U> UnwindSafe for CopyingSource<S, U>
where S: UnwindSafe, U: 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, 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.