pub trait Fasta: Sized {
// Required methods
fn to_fasta<T: Write>(
&self,
writer: &mut T,
) -> Result<(), Box<dyn StdError>>;
fn from_fasta<T: BufRead>(reader: &mut T) -> Result<Self, Box<dyn StdError>>;
// Provided methods
fn estimate_fasta_size(&self) -> usize { ... }
fn to_fasta_string(&self) -> Result<String, Box<dyn StdError>> { ... }
fn to_fasta_file<P: AsRef<Path>>(
&self,
path: P,
) -> Result<(), Box<dyn StdError>> { ... }
fn from_fasta_string(text: &str) -> Result<Self, Box<dyn StdError>> { ... }
fn from_fasta_file<P: AsRef<Path>>(
path: P,
) -> Result<Self, Box<dyn StdError>> { ... }
}Expand description
Serialize to and from FASTA.
§Serialized Format
>sp|P46406|G3P_RABIT Glyceraldehyde-3-phosphate dehydrogenase OS=Oryctolagus cuniculus GN=GAPDH PE=1 SV=3
MVKVGVNGFGRIGRLVTRAAFNSGKVDVVAINDPFIDLHYMVYMFQYDSTHGKFHGTVKA
ENGKLVINGKAITIFQERDPANIKWGDAGAEYVVESTGVFTTMEKAGAHLKGGAKRVIIS
APSADAPMFVMGVNHEKYDNSLKIVSNASCTTNCLAPLAKVIHDHFGIVEGLMTTVHAIT
ATQKTVDGPSGKLWRDGRGAAQNIIPASTGAAKAVGKVIPELNGKLTGMAFRVPTPNVSV
VDLTCRLEKAAKYDDIKKVVKQASEGPLKGILGYTEDQVVSCDFNSATHSSTFDAGAGIA
LNDHFVKLISWYDNEFGYSNRVVDLMVHMASKERequired Methods§
Provided Methods§
Sourcefn estimate_fasta_size(&self) -> usize
fn estimate_fasta_size(&self) -> usize
Estimate the size of the resulting FASTA output to avoid reallocations.
Sourcefn to_fasta_file<P: AsRef<Path>>(
&self,
path: P,
) -> Result<(), Box<dyn StdError>>
fn to_fasta_file<P: AsRef<Path>>( &self, path: P, ) -> Result<(), Box<dyn StdError>>
Export model to FASTA output file.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.