Skip to content

Commit

Permalink
add get_ref method
Browse files Browse the repository at this point in the history
  • Loading branch information
Object905 authored and BurntSushi committed Jan 5, 2018
1 parent f9ac150 commit 8cab86f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/frame.rs
Expand Up @@ -115,6 +115,11 @@ impl<W: Write> Writer<W> {
Err(err) => Err(new_into_inner_error(self, err)),
}
}

/// Gets a reference to the underlying writer in this encoder.
pub fn get_ref(&self) -> &W {
&self.inner.as_ref().unwrap().w
}
}

impl<W: Write> Drop for Writer<W> {
Expand Down Expand Up @@ -256,6 +261,11 @@ impl<R: Read> Reader<R> {
read_stream_ident: false,
}
}

/// Gets a reference to the underlying reader in this decoder.
pub fn get_ref(&self) -> &R {
&self.r
}
}

impl<R: Read> Read for Reader<R> {
Expand Down

0 comments on commit 8cab86f

Please sign in to comment.