@@ -26,6 +26,10 @@ pub enum BackendMessage {
2626 CommandComplete {
2727 pub tag : String ,
2828 } ,
29+ CopyInResponse {
30+ pub format : u8 ,
31+ pub column_formats : Vec < u16 > ,
32+ } ,
2933 DataRow {
3034 pub row : Vec < Option < Vec < u8 > > >
3135 } ,
@@ -86,6 +90,13 @@ pub enum FrontendMessage<'a> {
8690 pub variant : u8 ,
8791 pub name : & ' a str
8892 } ,
93+ CopyData {
94+ pub data : & ' a [ u8 ] ,
95+ } ,
96+ CopyDone ,
97+ CopyFail {
98+ pub message : & ' a str
99+ } ,
89100 Describe {
90101 pub variant : u8 ,
91102 pub name : & ' a str
@@ -177,6 +188,17 @@ impl<W: Writer> WriteMessage for W {
177188 try!( buf. write_u8 ( variant) ) ;
178189 try!( buf. write_cstr ( name) ) ;
179190 }
191+ CopyData { data } => {
192+ ident = Some ( b'd' ) ;
193+ try!( buf. write ( data) ) ;
194+ }
195+ CopyDone => {
196+ ident = Some ( b'C' ) ;
197+ }
198+ CopyFail { message } => {
199+ ident = Some ( b'f' ) ;
200+ try!( buf. write_cstr ( message) ) ;
201+ }
180202 Describe { variant, name } => {
181203 ident = Some ( b'D' ) ;
182204 try!( buf. write_u8 ( variant) ) ;
@@ -276,6 +298,17 @@ impl<R: Reader> ReadMessage for R {
276298 b'C' => CommandComplete { tag : try!( buf. read_cstr ( ) ) } ,
277299 b'D' => try!( read_data_row ( & mut buf) ) ,
278300 b'E' => ErrorResponse { fields : try!( read_fields ( & mut buf) ) } ,
301+ b'G' => {
302+ let format = try!( buf. read_u8 ( ) ) ;
303+ let mut column_formats = vec ! [ ] ;
304+ for _ in range ( 0 , try!( buf. read_be_u16 ( ) ) ) {
305+ column_formats. push ( try!( buf. read_be_u16 ( ) ) ) ;
306+ }
307+ CopyInResponse {
308+ format : format,
309+ column_formats : column_formats,
310+ }
311+ }
279312 b'I' => EmptyQueryResponse ,
280313 b'K' => BackendKeyData {
281314 process_id : try!( buf. read_be_u32 ( ) ) ,
0 commit comments