multipart_write/io/
mod.rs

1//! Foreign writer types.
2//!
3//! This module implements `MultipartWrite` for the `tokio` and `std` writer
4//! types, and it exports constructors for creating these implementations.
5use std::io::Write;
6
7#[cfg(feature = "tokio")]
8mod multi_async_writer;
9#[cfg(feature = "tokio")]
10#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
11#[doc(inline)]
12pub use multi_async_writer::{MultiAsyncWriter, async_writer};
13
14mod multi_io_writer;
15pub use multi_io_writer::MultiIoWriter;
16
17/// Constructs a `MultipartWrite` from an `std::io::Write`.
18pub fn io_writer<W: Write + Default>(write: W) -> MultiIoWriter<W> {
19    MultiIoWriter::new(write)
20}