pub struct ErrorRegistry { /* private fields */ }
Expand description
A central registry for error codes and metadata
Implementations§
Source§impl ErrorRegistry
impl ErrorRegistry
Sourcepub fn register_code(
&self,
code: String,
description: String,
documentation_url: Option<String>,
retryable: bool,
) -> Result<(), String>
pub fn register_code( &self, code: String, description: String, documentation_url: Option<String>, retryable: bool, ) -> Result<(), String>
Register an error code with metadata
Sourcepub fn get_code_info(&self, code: &str) -> Option<ErrorCodeInfo>
pub fn get_code_info(&self, code: &str) -> Option<ErrorCodeInfo>
Get info about a registered error code
Sourcepub fn is_registered(&self, code: &str) -> bool
pub fn is_registered(&self, code: &str) -> bool
Check if an error code is registered
Sourcepub fn global() -> &'static ErrorRegistry
pub fn global() -> &'static ErrorRegistry
Get the global error registry instance
Auto Trait Implementations§
impl !Freeze for ErrorRegistry
impl RefUnwindSafe for ErrorRegistry
impl Send for ErrorRegistry
impl Sync for ErrorRegistry
impl Unpin for ErrorRegistry
impl UnwindSafe for ErrorRegistry
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