1 use anyhow
::{bail, Error}
;
7 pub use command_socket
::*;
10 pub use file_logger
::{FileLogger, FileLogOptions}
;
13 pub use api_config
::ApiConfig
;
20 impl From
<Error
> for AuthError
{
21 fn from(err
: Error
) -> Self {
22 AuthError
::Generic(err
)
29 headers
: &http
::HeaderMap
,
30 method
: &hyper
::Method
,
31 ) -> Result
<String
, AuthError
>;
34 static mut SHUTDOWN_REQUESTED
: bool
= false;
36 pub fn request_shutdown() {
38 SHUTDOWN_REQUESTED
= true;
40 crate::server_shutdown();
44 pub fn shutdown_requested() -> bool
{
45 unsafe { SHUTDOWN_REQUESTED }
48 pub fn fail_on_shutdown() -> Result
<(), Error
> {
49 if shutdown_requested() {
50 bail
!("Server shutdown requested - aborting task");