Document a way to limit read_line length
This commit is contained in:
parent
1a983536f3
commit
3a6ceeb18f
1 changed files with 3 additions and 2 deletions
|
@ -2153,10 +2153,11 @@ pub trait BufRead: Read {
|
||||||
///
|
///
|
||||||
/// This function is blocking and should be used carefully: it is possible for
|
/// This function is blocking and should be used carefully: it is possible for
|
||||||
/// an attacker to continuously send bytes without ever sending a newline
|
/// an attacker to continuously send bytes without ever sending a newline
|
||||||
/// or EOF.
|
/// or EOF. You can use [`take`] to limit the maximum number of bytes read.
|
||||||
///
|
///
|
||||||
/// [`Ok(0)`]: Ok
|
/// [`Ok(0)`]: Ok
|
||||||
/// [`clear`]: String:::clear
|
/// [`clear`]: String::clear
|
||||||
|
/// [`take`]: crate::io::Read::take
|
||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue