Function read_from_file

Source
pub fn read_from_file<T>(path: &Path) -> Result<T>
where T: FromStr, T::Err: Error + Send + Sync + 'static,
Expand description

Read a file and parse its content into the specified type.

Trims whitespace before parsing.

ยงErrors

Returns an error if reading or parsing fails.