diff --git a/tokio/src/fs/file.rs b/tokio/src/fs/file.rs index 8d8bc9fb5..d8b01ef12 100644 --- a/tokio/src/fs/file.rs +++ b/tokio/src/fs/file.rs @@ -579,6 +579,11 @@ impl File { pub fn set_max_buf_size(&mut self, max_buf_size: usize) { self.max_buf_size = max_buf_size; } + + /// Get the maximum buffer size for the underlying [`AsyncRead`] / [`AsyncWrite`] operation. + pub fn max_buf_size(&self) -> usize { + self.max_buf_size + } } impl AsyncRead for File {