Struct restructure::Restruct [] [src]

pub struct Restruct;

Contains the fill method used to fill the struct with fields


impl Restruct

This function takes a RegexStruct and a Slice and returns a RegexStruct with its fields filled with the patterns from the text

 regexify! ( Details {
 name, String, r"\w+"
 _w, String, r"\s+"
 age, i32, r"\d+"

let user: Details = Default::default();

let obama = Restruct::fill(&user, "Obama 54");

assert_eq!(54, obama.age);