Trait prse::LendingFromStr
source · pub trait LendingFromStr<'a> {
fn from_str(s: &'a str) -> Result<Self, ParseError>
where
Self: Sized;
}Expand description
Parse a string into the implemented type, unlike FromStr this trait allows
you to borrow the string.
Required Methods§
sourcefn from_str(s: &'a str) -> Result<Self, ParseError>where
Self: Sized,
fn from_str(s: &'a str) -> Result<Self, ParseError>where
Self: Sized,
Parses a string s to return value of this type.
If parsing succeeds, return the value inside Ok, otherwise
when the string is ill-formatted return a ParseError.