pub struct VibeEngineError { /* private fields */ }Expand description
Error type returned by vibe-ready operations. Error returned by vibe-ready operations.
Implementations§
Source§impl VibeEngineError
impl VibeEngineError
Sourcepub fn kind(&self) -> VibeErrorKind
pub fn kind(&self) -> VibeErrorKind
Sourcepub fn source_message(&self) -> Option<&str>
pub fn source_message(&self) -> Option<&str>
Sourcepub fn with_source(self, source: impl Into<String>) -> Self
pub fn with_source(self, source: impl Into<String>) -> Self
Attaches a source message to this error.
§Returns
The updated error value.
§Examples
use vibe_ready::{VibeEngineError, VibeErrorCode};
let error = VibeEngineError::from_error_code(VibeErrorCode::RuntimeError)
.with_source("worker stopped");
assert_eq!(error.source_message(), Some("worker stopped"));Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Sourcepub fn from_success() -> Self
pub fn from_success() -> Self
Creates the canonical success value.
§Returns
A VibeEngineError whose code is VibeEngineErrorCode::Success.
Sourcepub fn from_u16(code: u16) -> Self
pub fn from_u16(code: u16) -> Self
Creates an error from an unsigned 16-bit raw code.
§Returns
A raw-code error with VibeErrorKind::Unknown.
Sourcepub fn from_u32(code: u32) -> Self
pub fn from_u32(code: u32) -> Self
Creates an error from an unsigned 32-bit raw code.
§Returns
A raw-code error with VibeErrorKind::Unknown.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Checks whether this error represents success.
§Returns
true when the code is VibeEngineErrorCode::Success.
Sourcepub fn from_error_code(value: VibeEngineErrorCode) -> Self
pub fn from_error_code(value: VibeEngineErrorCode) -> Self
Creates an error from a stable code variant.
§Returns
A VibeEngineError with default kind and message for the code.
Sourcepub fn from_code(value: VibeEngineErrorCode) -> Self
pub fn from_code(value: VibeEngineErrorCode) -> Self
Creates an error from a stable code variant.
§Returns
A VibeEngineError with default kind and message for the code.
Sourcepub fn from_error_code_msg(value: VibeEngineErrorCode, msg: String) -> Self
pub fn from_error_code_msg(value: VibeEngineErrorCode, msg: String) -> Self
Creates an error from a code variant and custom message.
§Returns
A VibeEngineError using msg as the display message.
Sourcepub fn from_task_interruption_error() -> Self
pub fn from_task_interruption_error() -> Self
Creates the standard task-interruption error.
§Returns
A VibeEngineError with VibeEngineErrorCode::TaskInterruptionError.
Sourcepub fn from_internal_error() -> Self
pub fn from_internal_error() -> Self
Creates the standard internal error.
§Returns
Sourcepub fn from_mpsc_send_error() -> Self
pub fn from_mpsc_send_error() -> Self
Creates the standard MPSC send error.
§Returns
Sourcepub fn from_parameter_empty() -> Self
pub fn from_parameter_empty() -> Self
Creates the standard empty-parameter error.
§Returns
Sourcepub fn from_parameter_empty_log(tag: &str) -> Self
pub fn from_parameter_empty_log(tag: &str) -> Self
Logs and creates the standard empty-parameter error.
§Returns
Trait Implementations§
Source§impl Clone for VibeEngineError
impl Clone for VibeEngineError
Source§fn clone(&self) -> VibeEngineError
fn clone(&self) -> VibeEngineError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VibeEngineError
impl Debug for VibeEngineError
Source§impl Display for VibeEngineError
impl Display for VibeEngineError
Source§impl Error for VibeEngineError
impl Error for VibeEngineError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<DbError> for VibeEngineError
impl From<DbError> for VibeEngineError
Auto Trait Implementations§
impl Freeze for VibeEngineError
impl RefUnwindSafe for VibeEngineError
impl Send for VibeEngineError
impl Sync for VibeEngineError
impl Unpin for VibeEngineError
impl UnsafeUnpin for VibeEngineError
impl UnwindSafe for VibeEngineError
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more