File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -414,14 +414,16 @@ impl Client {
414414 self . connection . block_on ( self . client . simple_query ( query) )
415415 }
416416
417- /// Validates connection, timing out after specified duration.
417+ /// Validates the connection by performing a simple no-op query.
418+ ///
419+ /// If the specified timeout is reached before the backend responds, an error will be returned.
418420 pub fn is_valid ( & mut self , timeout : Duration ) -> Result < ( ) , Error > {
419421 let inner_client = & self . client ;
420422 self . connection . block_on ( async {
421423 let trivial_query = inner_client. simple_query ( "" ) ;
422424 tokio:: time:: timeout ( timeout, trivial_query)
423425 . await
424- . map_err ( |_| Error :: timeout ( ) ) ?
426+ . map_err ( |_| Error :: __private_api_timeout ( ) ) ?
425427 . map ( |_| ( ) )
426428 } )
427429 }
Original file line number Diff line number Diff line change @@ -495,7 +495,7 @@ impl Error {
495495 }
496496
497497 #[ doc( hidden) ]
498- pub fn timeout ( ) -> Error {
498+ pub fn __private_api_timeout ( ) -> Error {
499499 Error :: new ( Kind :: Timeout , None )
500500 }
501501}
You can’t perform that action at this time.
0 commit comments