i notice the form_str trait is not support the lifetime . if i don't impl the trait .
i write a method . return the Result or Option . can it include the lifetime ?
FromStr does not have a lifetime parameter, and so you can only parse types that do not contain a lifetime parameter themselves. In other words, you can parse an i32 with FromStr, but not a &i32. You can parse a struct that contains an i32, but not one that contains an &i32.
You should not put temporary loans in structs. & is not for storing "by reference". It prevents storing data in structs.
Store strings as String, and you'll be able to implement FromStr easily, without scope of temporary variables limiting what can you do with the struct.