Function sqlib::map::update_from_map [] [src]

pub fn update_from_map<T>(map: &StringMap, key: &str, value: &mut T) where T: FromStr

This function gets the value to the key from the map, then parses it and mutates the given pointer.

Example

use sqlib::map::{to_map, update_from_map};

let map = to_map("key1=2");
let mut integer = 1i32;

update_from_map(&map, "key1", &mut integer);

assert_eq!(integer, 2);