Add session info accessor for copy out

This commit is contained in:
Steven Fackler 2015-08-15 23:37:56 -07:00
parent 6e99874bd9
commit 20ce974662

View File

@ -528,7 +528,7 @@ impl Format {
/// # Warning /// # Warning
/// ///
/// The underlying connection may not be used while a `CopyOutReader` exists. /// The underlying connection may not be used while a `CopyOutReader` exists.
/// Any calls to the connection with panic. /// Any attempt to do so will panic.
pub struct CopyOutReader<'a> { pub struct CopyOutReader<'a> {
conn: RefMut<'a, InnerConnection>, conn: RefMut<'a, InnerConnection>,
format: Format, format: Format,
@ -554,6 +554,11 @@ impl<'a> CopyOutReader<'a> {
&self.column_formats &self.column_formats
} }
/// Returns session info for the associated connection.
pub fn session_info<'b>(&'b self) -> SessionInfo<'b> {
SessionInfo::new(&*self.conn)
}
/// Consumes the `CopyOutReader`, throwing away any unread data. /// Consumes the `CopyOutReader`, throwing away any unread data.
/// ///
/// Functionally equivalent to `CopyOutReader`'s `Drop` implementation, /// Functionally equivalent to `CopyOutReader`'s `Drop` implementation,