pub struct StreamEncoder<W: Write> { /* private fields */ }Expand description
A stream encoder that implements StreamDecodee. Using this,
a ASN.1 stream can be written using a SAXParser style interface.
Implementations§
Source§impl<W: Write> StreamEncoder<W>
impl<W: Write> StreamEncoder<W>
pub fn new<T: Into<ByteWriter<W>>>(writer: T) -> Self
Trait Implementations§
Source§impl<W: Write> StreamDecodee for StreamEncoder<W>
impl<W: Write> StreamDecodee for StreamEncoder<W>
Source§fn start_element(&mut self, tag: Tag, len: Len) -> ParseResult
fn start_element(&mut self, tag: Tag, len: Len) -> ParseResult
This function is called when an ASN.1 tag is encountered. In other
words, at the start of an ASN.1 element.
Source§fn end_element(&mut self, _: Tag, _: Len) -> ParseResult
fn end_element(&mut self, _: Tag, _: Len) -> ParseResult
This function is called when an ASN.1 element has finished decoding.
Note that this is also called for all elements, even after a primitive()
call. For this reason, you may need to check the constructed flag in some
cases.
Source§fn primitive<I: Iterator<Item = Result<u8>>>(
&mut self,
reader: &mut ByteReader<I>,
len: LenNum,
) -> ParseResult
fn primitive<I: Iterator<Item = Result<u8>>>( &mut self, reader: &mut ByteReader<I>, len: LenNum, ) -> ParseResult
This function is called when a primitive element is encountered. Note that both
start_element and end_element are called before/after this function.
Source§fn warning(_: DecodeError) -> ParseResult
fn warning(_: DecodeError) -> ParseResult
This function would be called when a recoverable decode error occurs, however
currently nothing calls this.
Source§fn error(_: DecodeError)
fn error(_: DecodeError)
This function would be called when a fatal decoding error occurs, however
currently nothing calls this.
Auto Trait Implementations§
impl<W> Freeze for StreamEncoder<W>where
W: Freeze,
impl<W> RefUnwindSafe for StreamEncoder<W>where
W: RefUnwindSafe,
impl<W> Send for StreamEncoder<W>where
W: Send,
impl<W> Sync for StreamEncoder<W>where
W: Sync,
impl<W> Unpin for StreamEncoder<W>where
W: Unpin,
impl<W> UnwindSafe for StreamEncoder<W>where
W: UnwindSafe,
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