Trait std::convert::From
[−]
[src]
pub trait From<T> {
fn from(T) -> Self;
}Construct Self`Self` via a conversion.
Examples
String`Stringimplements` implements From<&str>`From<&str>`:
let string = "hello".to_string(); let other_string = String::from("hello"); assert_eq!(string, other_string);
Required Methods
fn from(T) -> Self
Performs the conversion.
Implementors
impl<T> From<T> for Timpl<'a> From<&'a str> for Stringimpl<'a> From<&'a str> for Cow<'a, str>impl<'a> From<String> for Cow<'a, str>impl<'a, T> From<&'a [T]> for Vec<T> where T: Cloneimpl<'a> From<&'a str> for Vec<u8>impl<'a, E: Error + 'a> From<E> for Box<Error + 'a>impl<'a, E: Error + Send + Sync + 'a> From<E> for Box<Error + Send + Sync + 'a>impl From<String> for Box<Error + Send + Sync>impl<'a, 'b> From<&'b str> for Box<Error + Send + Sync + 'a>impl From<NulError> for Errorimpl From<String> for OsStringimpl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for OsStringimpl<W> From<IntoInnerError<W>> for Errorimpl From<Ipv4Addr> for u32impl From<u32> for Ipv4Addrimpl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for PathBufimpl From<OsString> for PathBufimpl From<String> for PathBufimpl<T> From<PoisonError<T>> for TryLockError<T>