Trait std::convert::From
[−]
[src]
pub trait From<T> { fn from(T) -> Self; }
Construct Self
via a conversion.
Examples
String
implements 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 T
impl<'a> From<&'a str> for String
impl<'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: Clone
impl<'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 Error
impl From<String> for OsString
impl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for OsString
impl<W> From<IntoInnerError<W>> for Error
impl From<Ipv4Addr> for u32
impl From<u32> for Ipv4Addr
impl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for PathBuf
impl From<OsString> for PathBuf
impl From<String> for PathBuf
impl<T> From<PoisonError<T>> for TryLockError<T>