[−][src]Struct bcder::decode::CaptureSource
A source that captures what has been advanced over.
A capture source wraps a mutable reference to some other source and provides the usual source access. However, instead of dropping octets that have been advanced over, it keeps them around and allows taking them out as a bytes value.
This type is used by Constructed::capture
.
Implementations
impl<'a, S: Source> CaptureSource<'a, S>
[src]
pub fn new(source: &'a mut S) -> Self
[src]
Creates a new capture source using a reference to some other source.
pub fn into_bytes(self) -> Bytes
[src]
Converts the capture source into the captured bytes.
pub fn skip(self)
[src]
Drops the captured bytes.
Advances the underlying source to the end of the captured bytes.
Trait Implementations
impl<'a, S: Source + 'a> Source for CaptureSource<'a, S>
[src]
type Err = S::Err
The error produced by the source. Read more
pub fn request(&mut self, len: usize) -> Result<usize, Self::Err>
[src]
pub fn advance(&mut self, len: usize) -> Result<(), Self::Err>
[src]
pub fn slice(&self) -> &[u8]
[src]
pub fn bytes(&self, start: usize, end: usize) -> Bytes
[src]
pub fn take_u8(&mut self) -> Result<u8, Self::Err>
[src]
pub fn take_opt_u8(&mut self) -> Result<Option<u8>, Self::Err>
[src]
Auto Trait Implementations
impl<'a, S> RefUnwindSafe for CaptureSource<'a, S> where
S: RefUnwindSafe,
[src]
S: RefUnwindSafe,
impl<'a, S> Send for CaptureSource<'a, S> where
S: Send,
[src]
S: Send,
impl<'a, S> Sync for CaptureSource<'a, S> where
S: Sync,
[src]
S: Sync,
impl<'a, S> Unpin for CaptureSource<'a, S>
[src]
impl<'a, S> !UnwindSafe for CaptureSource<'a, S>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,