Skip to main content

load_text

Function load_text 

Source
pub fn load_text(path: &Path) -> Result<String>
Expand description

Load a path as agent-editable UTF-8 text (sole-path Strict policy).

Thin alias of crate::files::load_text_strict for hosts that follow api::* only (#1910). Binary returns EditErrorKind::Binary; invalid UTF-8 returns EditErrorKind::InvalidEncoding (#1963). Directory / unreadable IO stay EditErrorKind::InvalidInput.

Display string in errors is the path’s lossy string form.