Function cargo_toml2::from_path

source ·
pub fn from_path<T: AsRef<Path>, R: DeserializeOwned>(
    path: T
) -> Result<R, CargoTomlError>
Expand description

Reads the file at path.

Examples

// Reading a CargoToml
let toml: CargoToml = from_path("Cargo.toml").expect("Failed to read Cargo.toml");

Errors

If reading the provided path fails, or deserialization fails.