parent
9ecc9896de
commit
4e8afd65f9
1 changed files with 5 additions and 2 deletions
|
@ -44,8 +44,11 @@ pub trait FromStr {
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
type Err;
|
type Err;
|
||||||
|
|
||||||
/// Parses a string `s` to return an optional value of this type. If the
|
/// Parses a string `s` to return a value of this type.
|
||||||
/// string is ill-formatted, the None is returned.
|
///
|
||||||
|
/// If parsing succeeds, return the value inside `Ok`, otherwise
|
||||||
|
/// when the string is ill-formatted return an error specific to the
|
||||||
|
/// inside `Err`. The error type is specific to implementation of the trait.
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err>;
|
fn from_str(s: &str) -> Result<Self, Self::Err>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue