Trait fastobo::parser::FromSlice

source ·
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§

source

type Err

The associated error which can be returned from parsing.

Required Methods§

source

fn from_slice(s: &'i str) -> Result<Self, Self::Err>

Parses a string slice s to return a value of this type.

Implementors§

source§

impl<'i, T> FromSlice<'i> for Twhere T: FromStr,

§

type Err = <T as FromStr>::Err