|
|
@ -4,11 +4,9 @@ use std::pin::Pin;
|
|
|
|
use pin_project_lite::pin_project;
|
|
|
|
use pin_project_lite::pin_project;
|
|
|
|
|
|
|
|
|
|
|
|
use crate::io::write::WriteExt;
|
|
|
|
use crate::io::write::WriteExt;
|
|
|
|
use crate::io::{self, Seek, SeekFrom, Write};
|
|
|
|
use crate::io::{self, Seek, SeekFrom, Write, DEFAULT_BUF_SIZE};
|
|
|
|
use crate::task::{Context, Poll, ready};
|
|
|
|
use crate::task::{Context, Poll, ready};
|
|
|
|
|
|
|
|
|
|
|
|
const DEFAULT_CAPACITY: usize = 8 * 1024;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pin_project! {
|
|
|
|
pin_project! {
|
|
|
|
/// Wraps a writer and buffers its output.
|
|
|
|
/// Wraps a writer and buffers its output.
|
|
|
|
///
|
|
|
|
///
|
|
|
@ -107,7 +105,7 @@ impl<W: Write> BufWriter<W> {
|
|
|
|
/// # Ok(()) }) }
|
|
|
|
/// # Ok(()) }) }
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
pub fn new(inner: W) -> BufWriter<W> {
|
|
|
|
pub fn new(inner: W) -> BufWriter<W> {
|
|
|
|
BufWriter::with_capacity(DEFAULT_CAPACITY, inner)
|
|
|
|
BufWriter::with_capacity(DEFAULT_BUF_SIZE, inner)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Creates a new `BufWriter` with the specified buffer capacity.
|
|
|
|
/// Creates a new `BufWriter` with the specified buffer capacity.
|
|
|
|