pub struct ErrorCatalog { /* private fields */ }Expand description
Validated lookup table of stable domain errors.
Implementations§
Source§impl ErrorCatalog
impl ErrorCatalog
pub fn new() -> Self
Sourcepub fn from_specs<I>(specs: I) -> Result<Self, ErrorCatalogError>where
I: IntoIterator<Item = ErrorSpec>,
pub fn from_specs<I>(specs: I) -> Result<Self, ErrorCatalogError>where
I: IntoIterator<Item = ErrorSpec>,
Validate and collect a finite set of declarations.
Sourcepub fn insert(&mut self, spec: ErrorSpec) -> Result<(), ErrorCatalogError>
pub fn insert(&mut self, spec: ErrorSpec) -> Result<(), ErrorCatalogError>
Validate and insert one declaration.
pub fn get(&self, code: &str) -> Option<&ErrorSpec>
Sourcepub fn builder(&self, code: &str) -> Result<ErrorBuilder, ErrorCatalogError>
pub fn builder(&self, code: &str) -> Result<ErrorBuilder, ErrorCatalogError>
Start a builder for a catalogued code.
Sourcepub fn event(&self, code: &str) -> Result<Event, ErrorCatalogError>
pub fn event(&self, code: &str) -> Result<Event, ErrorCatalogError>
Build a strict error event for a catalogued code.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for ErrorCatalog
impl Clone for ErrorCatalog
Source§fn clone(&self) -> ErrorCatalog
fn clone(&self) -> ErrorCatalog
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorCatalog
impl Debug for ErrorCatalog
Source§impl Default for ErrorCatalog
impl Default for ErrorCatalog
Source§fn default() -> ErrorCatalog
fn default() -> ErrorCatalog
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ErrorCatalog
impl RefUnwindSafe for ErrorCatalog
impl Send for ErrorCatalog
impl Sync for ErrorCatalog
impl Unpin for ErrorCatalog
impl UnsafeUnpin for ErrorCatalog
impl UnwindSafe for ErrorCatalog
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