@@ -193,19 +193,19 @@ impl IntoConnectParams for Url {
193193}
194194
195195/// Trait for types that can handle Postgres notice messages
196- pub trait NoticeHandler : Send {
196+ pub trait HandleNotice : Send {
197197 /// Handle a Postgres notice message
198- fn handle ( & mut self , notice : DbError ) ;
198+ fn handle_notice ( & mut self , notice : DbError ) ;
199199}
200200
201201/// A notice handler which logs at the `info` level.
202202///
203203/// This is the default handler used by a `Connection`.
204204#[ derive( Copy , Debug ) ]
205- pub struct DefaultNoticeHandler ;
205+ pub struct LoggingNoticeHandler ;
206206
207- impl NoticeHandler for DefaultNoticeHandler {
208- fn handle ( & mut self , notice : DbError ) {
207+ impl HandleNotice for LoggingNoticeHandler {
208+ fn handle_notice ( & mut self , notice : DbError ) {
209209 info ! ( "{}: {}" , notice. severity( ) , notice. message( ) ) ;
210210 }
211211}
@@ -384,7 +384,7 @@ struct CachedStatement {
384384
385385struct InnerConnection {
386386 stream : BufferedStream < MaybeSslStream < InternalStream > > ,
387- notice_handler : Box < NoticeHandler > ,
387+ notice_handler : Box < HandleNotice > ,
388388 notifications : VecDeque < Notification > ,
389389 cancel_data : CancelData ,
390390 unknown_types : HashMap < Oid , Type > ,
@@ -417,7 +417,7 @@ impl InnerConnection {
417417 let mut conn = InnerConnection {
418418 stream : BufferedStream :: new ( stream) ,
419419 next_stmt_id : 0 ,
420- notice_handler : Box :: new ( DefaultNoticeHandler ) ,
420+ notice_handler : Box :: new ( LoggingNoticeHandler ) ,
421421 notifications : VecDeque :: new ( ) ,
422422 cancel_data : CancelData { process_id : 0 , secret_key : 0 } ,
423423 unknown_types : HashMap :: new ( ) ,
@@ -500,7 +500,7 @@ impl InnerConnection {
500500 match try_desync ! ( self , self . stream. read_message( ) ) {
501501 NoticeResponse { fields } => {
502502 if let Ok ( err) = ugh_privacy:: dberror_new_raw ( fields) {
503- self . notice_handler . handle ( err) ;
503+ self . notice_handler . handle_notice ( err) ;
504504 }
505505 Ok ( None )
506506 }
@@ -572,7 +572,7 @@ impl InnerConnection {
572572 }
573573 }
574574
575- fn set_notice_handler ( & mut self , handler : Box < NoticeHandler > ) -> Box < NoticeHandler > {
575+ fn set_notice_handler ( & mut self , handler : Box < HandleNotice > ) -> Box < HandleNotice > {
576576 mem:: replace ( & mut self . notice_handler , handler)
577577 }
578578
@@ -919,7 +919,7 @@ impl Connection {
919919 }
920920
921921 /// Sets the notice handler for the connection, returning the old handler.
922- pub fn set_notice_handler ( & self , handler : Box < NoticeHandler > ) -> Box < NoticeHandler > {
922+ pub fn set_notice_handler ( & self , handler : Box < HandleNotice > ) -> Box < HandleNotice > {
923923 self . conn . borrow_mut ( ) . set_notice_handler ( handler)
924924 }
925925
0 commit comments