Struct async_std::io::Chain [−][src]
pub struct Chain<T, U> { /* fields omitted */ }Expand description
Implementations
Consumes the Chain, returning the wrapped readers.
Examples
use async_std::prelude::*;
use async_std::fs::File;
let foo_file = File::open("foo.txt").await?;
let bar_file = File::open("bar.txt").await?;
let chain = foo_file.chain(bar_file);
let (foo_file, bar_file) = chain.into_inner();Gets references to the underlying readers in this Chain.
Examples
use async_std::prelude::*;
use async_std::fs::File;
let foo_file = File::open("foo.txt").await?;
let bar_file = File::open("bar.txt").await?;
let chain = foo_file.chain(bar_file);
let (foo_file, bar_file) = chain.get_ref();Gets mutable references to the underlying readers in this Chain.
Care should be taken to avoid modifying the internal I/O state of the
underlying readers as doing so may corrupt the internal state of this
Chain.
Examples
use async_std::prelude::*;
use async_std::fs::File;
let foo_file = File::open("foo.txt").await?;
let bar_file = File::open("bar.txt").await?;
let mut chain = foo_file.chain(bar_file);
let (foo_file, bar_file) = chain.get_mut();Trait Implementations
Attempt to return the contents of the internal buffer, filling it with more data from the inner reader if it is empty. Read more
Attempt to read from the AsyncRead into buf. Read more