#[non_exhaustive]pub enum Error {
Show 15 variants
Io(Error),
Parse {
line: u64,
kind: ParseError,
},
UnknownFormat {
hint: String,
},
InvalidByte {
id: String,
pos: usize,
byte: u8,
},
LengthMismatch {
id: String,
seq: usize,
quality: usize,
},
MissingQuality {
id: String,
},
Index(String),
UnknownSequence(String),
PairMismatch {
pairs_read: u64,
first: String,
second: String,
},
PairTruncated {
pairs_read: u64,
missing: &'static str,
},
OutOfBounds {
id: String,
start: u64,
end: u64,
length: u64,
},
TooLarge {
line: u64,
what: &'static str,
limit: usize,
},
FeatureDisabled(&'static str),
Unsupported(&'static str),
Other(String),
}Expand description
Everything that can go wrong while reading, writing or indexing sequences.
Marked #[non_exhaustive]: match with a _ arm, so that a future release can
describe a new failure without it being a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Underlying I/O failure.
Parse
The input is not valid FASTA/FASTQ.
Fields
kind: ParseErrorWhat exactly was wrong.
UnknownFormat
The format could not be inferred from a path or from the first bytes.
InvalidByte
A record contains a byte that is not allowed by the requested alphabet.
Fields
LengthMismatch
Sequence and quality strings have different lengths.
Fields
MissingQuality
A FASTQ record was requested but the sequence carries no quality string.
Index(String)
A FASTA index (.fai) is malformed or does not match the FASTA file.
UnknownSequence(String)
A sequence name was not found in a FASTA index.
PairMismatch
Paired reads went out of step: the mate names do not agree.
Fields
PairTruncated
One of a pair of inputs ended before the other.
Fields
OutOfBounds
A requested region lies outside the sequence.
Fields
TooLarge
A line or record exceeded a configured size limit.
Only produced when crate::ReaderBuilder::max_line_length or
crate::ReaderBuilder::max_record_length is set.
Fields
FeatureDisabled(&'static str)
The operation requires a cargo feature that was not enabled.
Unsupported(&'static str)
The operation cannot be performed on this input.
Other(String)
A context-specific message, for tools built on top of this library.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 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
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