pub struct AsyncBlastXmlIter<R>where
R: AsyncBufRead + Unpin,{ /* private fields */ }Implementations§
Source§impl<R> AsyncBlastXmlIter<R>where
R: AsyncBufRead + Unpin,
impl<R> AsyncBlastXmlIter<R>where
R: AsyncBufRead + Unpin,
Sourcepub fn from_reader(r: R) -> Self
pub fn from_reader(r: R) -> Self
Examples found in repository?
examples/src/blast_parse.rs (line 37)
28async fn main() -> Result<()> {
29 let args = Cli::parse();
30 let fmt = infer_format(&args.input, &args.format);
31 let reader_box = open_async_reader(&args.input).await?;
32 if fmt == "6" {
33 stream_outfmt6_to_json(reader_box).await?;
34 } else {
35 // Build AsyncBlastXmlIter from reader_box
36 let iter_reader = reader_box;
37 let mut iter = AsyncBlastXmlIter::from_reader(iter_reader);
38 while let Some(res) = iter.next_iteration().await {
39 match res {
40 Ok(iter_rec) => {
41 if args.json {
42 let mut buf = Vec::new();
43 serde_json::to_writer(&mut buf, &iter_rec)?;
44 buf.push(b'\n');
45 tokio::io::stdout().write_all(&buf).await?;
46 } else {
47 println!("query {:?} hits {}", iter_rec.query_def, iter_rec.hits.len());
48 }
49 }
50 Err(e) => eprintln!("xml parse error: {}", e),
51 }
52 }
53 }
54
55 Ok(())
56}Sourcepub async fn read_tag_content(&mut self, end_tag_name: &[u8]) -> Result<String>
pub async fn read_tag_content(&mut self, end_tag_name: &[u8]) -> Result<String>
Return the next iteration asynchronously (and none on EOF)
Sourcepub async fn next_iteration(&mut self) -> Option<Result<BlastXmlIteration>>
pub async fn next_iteration(&mut self) -> Option<Result<BlastXmlIteration>>
Examples found in repository?
examples/src/blast_parse.rs (line 38)
28async fn main() -> Result<()> {
29 let args = Cli::parse();
30 let fmt = infer_format(&args.input, &args.format);
31 let reader_box = open_async_reader(&args.input).await?;
32 if fmt == "6" {
33 stream_outfmt6_to_json(reader_box).await?;
34 } else {
35 // Build AsyncBlastXmlIter from reader_box
36 let iter_reader = reader_box;
37 let mut iter = AsyncBlastXmlIter::from_reader(iter_reader);
38 while let Some(res) = iter.next_iteration().await {
39 match res {
40 Ok(iter_rec) => {
41 if args.json {
42 let mut buf = Vec::new();
43 serde_json::to_writer(&mut buf, &iter_rec)?;
44 buf.push(b'\n');
45 tokio::io::stdout().write_all(&buf).await?;
46 } else {
47 println!("query {:?} hits {}", iter_rec.query_def, iter_rec.hits.len());
48 }
49 }
50 Err(e) => eprintln!("xml parse error: {}", e),
51 }
52 }
53 }
54
55 Ok(())
56}Auto Trait Implementations§
impl<R> Freeze for AsyncBlastXmlIter<R>where
R: Freeze,
impl<R> RefUnwindSafe for AsyncBlastXmlIter<R>where
R: RefUnwindSafe,
impl<R> Send for AsyncBlastXmlIter<R>where
R: Send,
impl<R> Sync for AsyncBlastXmlIter<R>where
R: Sync,
impl<R> Unpin for AsyncBlastXmlIter<R>
impl<R> UnwindSafe for AsyncBlastXmlIter<R>where
R: UnwindSafe,
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
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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.