1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::module_name_repetitions)]
#![deny(
missing_debug_implementations,
missing_docs,
missing_copy_implementations,
trivial_casts,
trivial_numeric_casts,
unreachable_pub,
unused_import_braces,
unused_qualifications,
unused_results
)]
//! entab is a library to parse different "record-formatted" file formats
//! into tabular form.
//!
//! Entab provides two different ways to parse each file it supports. If you
//! know the type of the file you'll be reading, you generally want to use the
//! specific parser for that file type which will return a record of a specific
//! type. For example, to parse the IDs out of a FASTA file you might do the
//! following:
//! ```
//! # #[cfg(feature = "std")] {
//! use std::fs::File;
//! use entab::parsers::fasta::{FastaReader, FastaRecord};
//!
//! let file = File::open("./tests/data/sequence.fasta")?;
//! let mut reader = FastaReader::new(file, None)?;
//! while let Some(FastaRecord { id, .. }) = reader.next()? {
//! println!("{}", id);
//! }
//! # }
//! # use entab::EtError;
//! # Ok::<(), EtError>(())
//! ```
//!
//! Alternatively, you may not know the type of file when writing your code so
//! you may want to abstract over as many types as possible. This is where the
//! slower, generic parser framework is used (for example, in the bindings
//! for different languages). This framework can optionally take a `parser_name`
//! to force it to use that specific parser and optional params to control
//! parser options.
//! ```
//! # #[cfg(feature = "std")] {
//! use std::fs::File;
//! use entab::filetype::FileType;
//! use entab::readers::get_reader;
//!
//! let file = File::open("./tests/data/sequence.fasta")?;
//! let (mut reader, _) = get_reader(file, None, None)?;
//! while let Some(record) = reader.next_record()? {
//! println!("{:?}", record[0]);
//! }
//! # }
//! # use entab::EtError;
//! # Ok::<(), EtError>(())
//! ```
extern crate alloc;
/// The buffer interface that underlies the file readers
pub mod buffer;
/// Generic file decompression
pub mod compression;
/// Miscellanous utility functions and error handling
pub mod error;
/// File format inference
pub mod filetype;
/// Lightweight parsers to read records out of buffers
pub mod parsers;
/// Parsers for specific file formats
pub mod readers;
/// Record and abstract record reading
pub mod record;
pub use error::EtError;