File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -414,14 +414,16 @@ impl Client {
414
414
self . connection . block_on ( self . client . simple_query ( query) )
415
415
}
416
416
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.
418
420
pub fn is_valid ( & mut self , timeout : Duration ) -> Result < ( ) , Error > {
419
421
let inner_client = & self . client ;
420
422
self . connection . block_on ( async {
421
423
let trivial_query = inner_client. simple_query ( "" ) ;
422
424
tokio:: time:: timeout ( timeout, trivial_query)
423
425
. await
424
- . map_err ( |_| Error :: timeout ( ) ) ?
426
+ . map_err ( |_| Error :: __private_api_timeout ( ) ) ?
425
427
. map ( |_| ( ) )
426
428
} )
427
429
}
Original file line number Diff line number Diff line change @@ -495,7 +495,7 @@ impl Error {
495
495
}
496
496
497
497
#[ doc( hidden) ]
498
- pub fn timeout ( ) -> Error {
498
+ pub fn __private_api_timeout ( ) -> Error {
499
499
Error :: new ( Kind :: Timeout , None )
500
500
}
501
501
}
You can’t perform that action at this time.
0 commit comments