#[non_exhaustive]pub enum DimaError {
Usage {
message: String,
hint: Option<String>,
},
InputFormat {
location: Box<Location>,
message: String,
hint: Option<String>,
},
InputData {
location: Option<Box<Location>>,
message: String,
hint: Option<String>,
},
Io {
action: IoAction,
target: IoTarget,
source: Error,
},
System {
what: String,
source: Error,
},
InputChanged {
source_name: String,
},
Cancelled,
Overflow {
what: &'static str,
},
Internal {
message: String,
},
}Expand description
Every error the library reports.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Usage
Invalid parameters (exit 2).
InputFormat
The input is not a well-formed FASTA alignment (exit 4). Raised in every validation mode.
Fields
InputData
The input is well-formed but its content is invalid or unsupported (exit 4).
Fields
Io
A file or stream could not be opened, read or written (exit 3).
Fields
System
The operating system refused a resource the run needs, such as a thread (exit 3): the environment’s limits, not the input and not a bug.
Fields
InputChanged
The input’s first batch differs from what a pre-check saw (D108): the file changed after it was checked (exit 3; only front ends that pre-check, such as the desktop app, set the expectation).
Cancelled
The operation was cancelled by the user or a signal.
Overflow
A 64-bit counter would overflow (exit 4).
Internal
A broken internal invariant: a bug (exit 1).
Implementations§
Source§impl DimaError
impl DimaError
Sourcepub fn input_format(location: Location, message: impl Into<String>) -> Self
pub fn input_format(location: Location, message: impl Into<String>) -> Self
A structural input error at location.
Sourcepub fn input_data(
location: Option<Location>,
message: impl Into<String>,
) -> Self
pub fn input_data( location: Option<Location>, message: impl Into<String>, ) -> Self
An invalid-data error, optionally at location.
Sourcepub fn system(what: impl Into<String>, source: Error) -> Self
pub fn system(what: impl Into<String>, source: Error) -> Self
A thread the run needs could not be started.
Sourcepub fn with_hint(self, new_hint: impl Into<String>) -> Self
pub fn with_hint(self, new_hint: impl Into<String>) -> Self
Attaches a hint to errors that carry one; other errors are returned unchanged.
Sourcepub fn is_broken_pipe(&self) -> bool
pub fn is_broken_pipe(&self) -> bool
true for a write to standard output that failed because the reader went away
(dima … | head); front ends treat this as success.
Trait Implementations§
Source§impl Error for DimaError
impl Error for DimaError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for DimaError
impl !UnwindSafe for DimaError
impl Freeze for DimaError
impl Send for DimaError
impl Sync for DimaError
impl Unpin for DimaError
impl UnsafeUnpin for DimaError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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