Struct asn1_der::CountingSource
source · pub struct CountingSource<'a, S: Source> { /* private fields */ }
Expand description
A source that counts the amount of elements read
Warning: if a call to read
would cause ctr
to exceed usize::max_value()
, this source
will return an error and the element that has been read from the underlying source will be
lost
Trait Implementations§
source§impl<'a, S: Source> Source for CountingSource<'a, S>
impl<'a, S: Source> Source for CountingSource<'a, S>
source§fn counting_source(self, ctr: &mut usize) -> CountingSource<'_, Self>
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>
fn copying_source<U: Sink>(self, sink: U) -> CopyingSource<Self, U>
Creates a copying source
Auto Trait Implementations§
impl<'a, S> RefUnwindSafe for CountingSource<'a, S>where S: RefUnwindSafe,
impl<'a, S> Send for CountingSource<'a, S>where S: Send,
impl<'a, S> Sync for CountingSource<'a, S>where S: Sync,
impl<'a, S> Unpin for CountingSource<'a, S>where S: Unpin,
impl<'a, S> !UnwindSafe for CountingSource<'a, S>
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