Trait bitflags::__core::prelude::v1::From
[−]
[src]
pub trait From<T> { fn from(T) -> Self; }
Construct Self
via a conversion.
Note: this trait must not fail. If the conversion can fail, use a dedicated method which
return an Option<T>
or a Result<T, E>
.
Examples
String
implements From<&str>
:
let string = "hello".to_string(); let other_string = String::from("hello"); assert_eq!(string, other_string);
Generic impls
From<T> for U
impliesInto<U> for T
from()
is reflexive, which means thatFrom<T> for T
is implemented
Required Methods
fn from(T) -> Self
Performs the conversion.
Implementors
impl<T> From<T> for Box<T>
impl<T> From<T> for Arc<T>
impl<T> From<T> for Rc<T>
impl From<u8> for u16
impl From<u8> for u32
impl From<u8> for u64
impl From<u8> for usize
impl From<u16> for u32
impl From<u16> for u64
impl From<u32> for u64
impl From<i8> for i16
impl From<i8> for i32
impl From<i8> for i64
impl From<i8> for isize
impl From<i16> for i32
impl From<i16> for i64
impl From<i32> for i64
impl From<u8> for i16
impl From<u8> for i32
impl From<u8> for i64
impl From<u16> for i32
impl From<u16> for i64
impl From<u32> for i64
impl From<i8> for f32
impl From<i8> for f64
impl From<i16> for f32
impl From<i16> for f64
impl From<i32> for f64
impl From<u8> for f32
impl From<u8> for f64
impl From<u16> for f32
impl From<u16> for f64
impl From<u32> for f64
impl From<f32> for f64
impl<T> From<T> for T
impl<T> From<Vec<T>> for BinaryHeap<T> where T: Ord
impl<T> From<BinaryHeap<T>> for Vec<T>
impl<'a, T> From<&'a mut Option<Box<Node<T>>>> for Rawlink<Node<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, T> From<&'a [T]> for Cow<'a, [T]> where T: Clone
impl<'a, T> From<Vec<T>> for Cow<'a, [T]> where T: Clone
impl<'a, E> From<E> for Box<Error + 'a> where E: 'a + Error
impl<'a, E> From<E> for Box<Error + 'a + Send + Sync> where E: Send + Sync + 'a + Error
impl From<String> for Box<Error + 'static + Send + Sync>
impl From<String> for Box<Error + 'static>
impl<'a, 'b> From<&'b str> for Box<Error + 'a + Send + Sync>
impl<'a> From<&'a str> for Box<Error + 'static>
impl From<CString> for Vec<u8>
impl From<NulError> for Error
impl<'a> From<&'a CStr> for CString
impl From<String> for OsString
impl<'a, T> From<&'a T> for OsString where T: AsRef<OsStr> + ?Sized
impl<W> From<IntoInnerError<W>> for Error
impl From<Ipv4Addr> for u32
impl From<u32> for Ipv4Addr
impl<'a, T> From<&'a T> for PathBuf where T: AsRef<OsStr> + ?Sized
impl From<OsString> for PathBuf
impl From<String> for PathBuf
impl<'a> From<&'a Path> for Cow<'a, Path>
impl<'a> From<PathBuf> for Cow<'a, Path>
impl<T> From<PoisonError<T>> for TryLockError<T>
impl From<timespec> for SystemTime