File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,23 @@ impl<W: Write> EncoderWriter<W> {
215215 debug_assert_eq ! ( 0 , self . output_occupied_len) ;
216216 Ok ( ( ) )
217217 }
218+
219+ /// Unwraps this `EncoderWriter`, returning the base writer it writes base64 encoded output
220+ /// to.
221+ ///
222+ /// Normally this method should not be needed, since `finish()` returns the inner writer if
223+ /// it completes successfully. That will also ensure all data has been flushed, which the
224+ /// `into_inner()` function does *not* do.
225+ ///
226+ /// Calling this method after `finish()` has completed successfully will panic, since the
227+ /// writer has already been returned.
228+ ///
229+ /// This method may be useful if the writer implements additional APIs beyond the `Write`
230+ /// trait. Note that the inner writer might be in an error state or have an incomplete
231+ /// base64 string written to it.
232+ pub fn into_inner ( mut self ) -> W {
233+ self . delegate . take ( ) . unwrap ( )
234+ }
218235}
219236
220237impl < W : Write > Write for EncoderWriter < W > {
You can’t perform that action at this time.
0 commit comments