#[non_exhaustive]pub enum WorkerError {
Show 13 variants
InvalidConfiguration(String),
StartupFailed(String),
AlreadyRunning,
NotRunning,
#[non_exhaustive] ConnectionFailed {
url: String,
reason: String,
},
PollingError(String),
RegistrationError(String),
#[non_exhaustive] HandlerNotFound {
handler_type: String,
name: String,
},
HandlerExecutionError(String),
ShutdownError(String),
#[non_exhaustive] ShutdownTimeout {
timeout: Duration,
},
#[non_exhaustive] ResourceExhausted {
resource: String,
},
#[non_exhaustive] TaskQueueNotFound {
queue: String,
},
}Expand description
Errors that can occur in a worker.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidConfiguration(String)
Worker configuration is invalid
StartupFailed(String)
Worker failed to start
AlreadyRunning
Worker already running
NotRunning
Worker not running
#[non_exhaustive]ConnectionFailed
Failed to connect to server
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
PollingError(String)
Polling error
RegistrationError(String)
Handler registration error
#[non_exhaustive]HandlerNotFound
Handler not found
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
HandlerExecutionError(String)
Handler execution error
ShutdownError(String)
Shutdown error
#[non_exhaustive]ShutdownTimeout
Shutdown timeout
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]ResourceExhausted
Resource exhausted
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]TaskQueueNotFound
Task queue not found
Implementations§
Source§impl WorkerError
impl WorkerError
Sourcepub fn connection_failed(
url: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn connection_failed( url: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a connection failed error
Sourcepub fn handler_not_found(
handler_type: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn handler_not_found( handler_type: impl Into<String>, name: impl Into<String>, ) -> Self
Create a handler not found error
Sourcepub fn invalid_configuration(reason: impl Into<String>) -> Self
pub fn invalid_configuration(reason: impl Into<String>) -> Self
Create an invalid configuration error
Sourcepub fn startup_failed(reason: impl Into<String>) -> Self
pub fn startup_failed(reason: impl Into<String>) -> Self
Create a startup failed error
Sourcepub fn polling_error(reason: impl Into<String>) -> Self
pub fn polling_error(reason: impl Into<String>) -> Self
Create a polling error
Sourcepub fn resource_exhausted(resource: impl Into<String>) -> Self
pub fn resource_exhausted(resource: impl Into<String>) -> Self
Create a resource exhausted error
Sourcepub fn shutdown_timeout(timeout: Duration) -> Self
pub fn shutdown_timeout(timeout: Duration) -> Self
Create a shutdown timeout error
Sourcepub fn task_queue_not_found(queue: impl Into<String>) -> Self
pub fn task_queue_not_found(queue: impl Into<String>) -> Self
Create a task queue not found error
Trait Implementations§
Source§impl Clone for WorkerError
impl Clone for WorkerError
Source§impl Debug for WorkerError
impl Debug for WorkerError
Source§impl Display for WorkerError
impl Display for WorkerError
Source§impl Error for WorkerError
impl Error for WorkerError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<WorkerError> for Error
impl From<WorkerError> for Error
Source§fn from(source: WorkerError) -> Self
fn from(source: WorkerError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for WorkerError
impl Freeze for WorkerError
impl Move for WorkerError
impl RefUnwindSafe for WorkerError
impl Send for WorkerError
impl Sync for WorkerError
impl Unpin for WorkerError
impl UnsafeUnpin for WorkerError
impl UnwindSafe for WorkerError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request