pub trait FromStrRegex: FromStr {
// Required method
fn from_str_regex() -> String;
}Available on crate feature
std only.Expand description
A trait for getting regex patterns that match strings parseable by FromStr.
When using #[derive(FromStr)] with the #[from_str(regex_infer)] attribute,
the regex pattern is obtained from the FromStrRegex implementation of the field’s type.
Required Methods§
Sourcefn from_str_regex() -> String
fn from_str_regex() -> String
Returns a regex pattern for strings that might be parseable by FromStr.
Note: Matching this pattern does not guarantee that the string can be parsed successfully.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.