Struct asn1_der::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> RefUnwindSafe for CopyingSource<S, U>where S: RefUnwindSafe, U: RefUnwindSafe,

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.