pub struct Error { /* private fields */ }Expand description
Custom error type for the ggen project
Implementations§
Source§impl Error
impl Error
Sourcepub fn with_context(message: &str, context: &str) -> Self
pub fn with_context(message: &str, context: &str) -> Self
Create an error with additional context
Sourcepub fn with_source(
message: &str,
source: Box<dyn StdError + Send + Sync>,
) -> Self
pub fn with_source( message: &str, source: Box<dyn StdError + Send + Sync>, ) -> Self
Create an error with a source error
Source§impl Error
impl Error
Sourcepub fn invalid_input(message: impl Into<String>) -> Self
pub fn invalid_input(message: impl Into<String>) -> Self
Create an invalid input error
Sourcepub fn network_error(message: impl Into<String>) -> Self
pub fn network_error(message: impl Into<String>) -> Self
Create a network error
Sourcepub fn feature_not_enabled(feature: &str, help: &str) -> Self
pub fn feature_not_enabled(feature: &str, help: &str) -> Self
Create a feature not enabled error
Sourcepub fn file_not_found(path: PathBuf) -> Self
pub fn file_not_found(path: PathBuf) -> Self
Create a file not found error
Sourcepub fn internal_error(message: impl Into<String>) -> Self
pub fn internal_error(message: impl Into<String>) -> Self
Create an internal error
Sourcepub fn invalid_state(message: impl Into<String>) -> Self
pub fn invalid_state(message: impl Into<String>) -> Self
Create an invalid state error
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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<AgentError> for Error
Convert agent errors to domain errors
impl From<AgentError> for Error
Convert agent errors to domain errors
Source§fn from(err: AgentError) -> Self
fn from(err: AgentError) -> Self
Converts to this type from the input type.
Source§impl From<CommandError> for Error
impl From<CommandError> for Error
Source§fn from(err: CommandError) -> Self
fn from(err: CommandError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigError> for Error
impl From<ConfigError> for Error
Source§fn from(err: ConfigError) -> Self
fn from(err: ConfigError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigError> for Error
impl From<ConfigError> for Error
Source§fn from(err: ConfigError) -> Self
fn from(err: ConfigError) -> Self
Converts to this type from the input type.
Source§impl From<InputValidationError> for Error
impl From<InputValidationError> for Error
Source§fn from(err: InputValidationError) -> Self
fn from(err: InputValidationError) -> Self
Converts to this type from the input type.
Source§impl From<PathValidationError> for Error
impl From<PathValidationError> for Error
Source§fn from(err: PathValidationError) -> Self
fn from(err: PathValidationError) -> Self
Converts to this type from the input type.
Source§impl<T> From<PoisonError<T>> for Error
impl<T> From<PoisonError<T>> for Error
Source§fn from(err: PoisonError<T>) -> Self
fn from(err: PoisonError<T>) -> Self
Converts to this type from the input type.
Source§impl From<QueryEvaluationError> for Error
impl From<QueryEvaluationError> for Error
Source§fn from(err: QueryEvaluationError) -> Self
fn from(err: QueryEvaluationError) -> Self
Converts to this type from the input type.
Source§impl From<SerializerError> for Error
impl From<SerializerError> for Error
Source§fn from(err: SerializerError) -> Self
fn from(err: SerializerError) -> Self
Converts to this type from the input type.
Source§impl From<SetLoggerError> for Error
impl From<SetLoggerError> for Error
Source§fn from(err: SetLoggerError) -> Self
fn from(err: SetLoggerError) -> Self
Converts to this type from the input type.
Source§impl From<StorageError> for Error
impl From<StorageError> for Error
Source§fn from(err: StorageError) -> Self
fn from(err: StorageError) -> Self
Converts to this type from the input type.
Source§impl From<TemplateSecurityError> for Error
impl From<TemplateSecurityError> for Error
Source§fn from(err: TemplateSecurityError) -> Self
fn from(err: TemplateSecurityError) -> Self
Converts to this type from the input type.
Source§impl From<ValidationError> for Error
impl From<ValidationError> for Error
Source§fn from(err: ValidationError) -> Self
fn from(err: ValidationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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> EvidenceKind for T
impl<T> EvidenceKind for T
default fn kind_label(&self) -> &'static str
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more