pub trait FromSlice<'i>: Sized {
type Err;
// Required method
fn from_slice(s: &'i str) -> Result<Self, Self::Err>;
}
Expand description
Parse a value from a slice with a lifetime parameter.
This trait is an extension of the FromStr
trait from the standard library,
and allows keeping a reference to the slice passed as argument.
Required Associated Types§
Required Methods§
sourcefn from_slice(s: &'i str) -> Result<Self, Self::Err>
fn from_slice(s: &'i str) -> Result<Self, Self::Err>
Parses a string slice s
to return a value of this type.