Trait Source

Source
pub trait Source: Sized {
    // Required method
    fn read(&mut self) -> Result<u8, Asn1DerError>;

    // Provided methods
    fn counting_source(self, ctr: &mut usize) -> CountingSource<'_, Self> { ... }
    fn copying_source<U: Sink>(self, sink: U) -> CopyingSource<Self, U> { ... }
}
Expand description

A trait defining a byte source

Required Methods§

Source

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

Reads the next element

Provided Methods§

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> Source for Iter<'a, u8>

Source§

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

Source§

impl<'a, A: Iterator<Item = &'a u8>, B: Iterator<Item = &'a u8>> Source for Chain<A, B>

Source§

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

Source§

impl<'a, I: Iterator<Item = &'a u8> + 'a> Source for Skip<I>

Source§

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

Source§

impl<S: Source> Source for &mut S

Source§

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

Implementors§

Source§

impl<'a, S: Source> Source for CountingSource<'a, S>

Source§

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