Skip to content

Commit 20ce974

Browse files
committed
Add session info accessor for copy out
1 parent 6e99874 commit 20ce974

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/stmt.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ impl Format {
528528
/// # Warning
529529
///
530530
/// The underlying connection may not be used while a `CopyOutReader` exists.
531-
/// Any calls to the connection with panic.
531+
/// Any attempt to do so will panic.
532532
pub struct CopyOutReader<'a> {
533533
conn: RefMut<'a, InnerConnection>,
534534
format: Format,
@@ -554,6 +554,11 @@ impl<'a> CopyOutReader<'a> {
554554
&self.column_formats
555555
}
556556

557+
/// Returns session info for the associated connection.
558+
pub fn session_info<'b>(&'b self) -> SessionInfo<'b> {
559+
SessionInfo::new(&*self.conn)
560+
}
561+
557562
/// Consumes the `CopyOutReader`, throwing away any unread data.
558563
///
559564
/// Functionally equivalent to `CopyOutReader`'s `Drop` implementation,

0 commit comments

Comments
 (0)