Skip to main content

from_value

Function from_value 

Source
pub fn from_value<T>(value: Value) -> Result<T>
Expand description

Convert a Value to a specific type T

ยงExamples

use libconfig::Value;

let v = Value::from_str("42").unwrap();
let num: i32 = libconfig::from_value(v).unwrap();
assert_eq!(num, 42);