pub enum ServiceError {
Store(StoreError),
Provider(ProviderError),
Json(Error),
Validation(Vec<ValidationError>),
Conflict(String),
NotFound(Id),
AlreadyClosed(Id),
}Expand description
Errors produced by KindlingService.
Mirrors the Result-type error surface of the TS service, which throws
Error for validation failures and lifecycle violations. Here those become
structured variants so callers can branch on them.
Variants§
Store(StoreError)
Underlying store failure (sqlite, JSON, IO, or a store lifecycle error not otherwise specialised by the service).
Provider(ProviderError)
Retrieval/provider failure.
Json(Error)
JSON (de)serialization failure (export/import bundle handling).
Validation(Vec<ValidationError>)
Input validation failed. Carries every field error, matching the TS validators which collect all problems before returning.
Conflict(String)
A session already has an open capsule (open lifecycle invariant).
NotFound(Id)
The referenced capsule does not exist.
AlreadyClosed(Id)
The capsule exists but is already closed.
Trait Implementations§
Source§impl Debug for ServiceError
impl Debug for ServiceError
Source§impl Display for ServiceError
impl Display for ServiceError
Source§impl Error for ServiceError
impl Error for ServiceError
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<Error> for ServiceError
impl From<Error> for ServiceError
Source§impl From<ProviderError> for ServiceError
impl From<ProviderError> for ServiceError
Source§fn from(source: ProviderError) -> Self
fn from(source: ProviderError) -> Self
Converts to this type from the input type.
Source§impl From<StoreError> for ServiceError
impl From<StoreError> for ServiceError
Source§fn from(source: StoreError) -> Self
fn from(source: StoreError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ServiceError
impl !UnwindSafe for ServiceError
impl Freeze for ServiceError
impl Send for ServiceError
impl Sync for ServiceError
impl Unpin for ServiceError
impl UnsafeUnpin for ServiceError
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