Skip to main content

read_bounded

Function read_bounded 

Source
pub fn read_bounded(
    path: &Path,
    max_bytes: usize,
) -> Result<Option<String>, String>
Expand description

Reads the UTF-8 text of the file at path, refusing more than max_bytes. None when there is no such file: nothing has been kept yet.

ยงErrors

Returns an error, without the path, when the file is unreadable, too long or not UTF-8.