Trait nom::lib::std::prelude::v1::rust_2015::From1.0.0[][src]

pub trait From<T> {
    fn from(T) -> Self;
}
Expand description

Used to do value-to-value conversions while consuming the input value. It is the reciprocal of Into.

One should always prefer implementing From over Into because implementing From automatically provides one with an implementation of Into thanks to the blanket implementation in the standard library.

Only implement Into when targeting a version prior to Rust 1.41 and converting to a type outside the current crate. From was not able to do these types of conversions in earlier versions because of Rust’s orphaning rules. See Into for more details.

Prefer using Into over using From when specifying trait bounds on a generic function. This way, types that directly implement Into can be used as arguments as well.

The From is also very useful when performing error handling. When constructing a function that is capable of failing, the return type will generally be of the form Result<T, E>. The From trait simplifies error handling by allowing a function to return a single error type that encapsulate multiple error types. See the “Examples” section and the book for more details.

Note: This trait must not fail. If the conversion can fail, use TryFrom.

Generic Implementations

  • From<T> for U implies Into<U> for T
  • From is reflexive, which means that From<T> for T is implemented

Examples

String implements From<&str>:

An explicit conversion from a &str to a String is done as follows:

let string = "hello".to_string();
let other_string = String::from("hello");

assert_eq!(string, other_string);

While performing error handling it is often useful to implement From for your own error type. By converting underlying error types to our own custom error type that encapsulates the underlying error type, we can return a single error type without losing information on the underlying cause. The ‘?’ operator automatically converts the underlying error type to our custom error type by calling Into<CliError>::into which is automatically provided when implementing From. The compiler then infers which implementation of Into should be used.

use std::fs;
use std::io;
use std::num;

enum CliError {
    IoError(io::Error),
    ParseError(num::ParseIntError),
}

impl From<io::Error> for CliError {
    fn from(error: io::Error) -> Self {
        CliError::IoError(error)
    }
}

impl From<num::ParseIntError> for CliError {
    fn from(error: num::ParseIntError) -> Self {
        CliError::ParseError(error)
    }
}

fn open_and_parse_file(file_name: &str) -> Result<i32, CliError> {
    let mut contents = fs::read_to_string(&file_name)?;
    let num: i32 = contents.trim().parse()?;
    Ok(num)
}

Required methods

Performs the conversion.

Implementations on Foreign Types

Creates an IpAddr::V6 from an eight element 16-bit array.

Examples
use std::net::{IpAddr, Ipv6Addr};

let addr = IpAddr::from([
    525u16, 524u16, 523u16, 522u16,
    521u16, 520u16, 519u16, 518u16,
]);
assert_eq!(
    IpAddr::V6(Ipv6Addr::new(
        0x20d, 0x20c,
        0x20b, 0x20a,
        0x209, 0x208,
        0x207, 0x206
    )),
    addr
);

Converts a RecvError into a RecvTimeoutError.

This conversion always returns RecvTimeoutError::Disconnected.

No data is allocated on the heap.

Convert a host byte order u128 into an Ipv6Addr.

Examples
use std::net::Ipv6Addr;

let addr = Ipv6Addr::from(0x102030405060708090A0B0C0D0E0F00D_u128);
assert_eq!(
    Ipv6Addr::new(
        0x1020, 0x3040, 0x5060, 0x7080,
        0x90A0, 0xB0C0, 0xD0E0, 0xF00D,
    ),
    addr);

Creates an Ipv6Addr from an eight element 16-bit array.

Examples
use std::net::Ipv6Addr;

let addr = Ipv6Addr::from([
    525u16, 524u16, 523u16, 522u16,
    521u16, 520u16, 519u16, 518u16,
]);
assert_eq!(
    Ipv6Addr::new(
        0x20d, 0x20c,
        0x20b, 0x20a,
        0x209, 0x208,
        0x207, 0x206
    ),
    addr
);

Creates an Ipv4Addr from a four element byte array.

Examples
use std::net::Ipv4Addr;

let addr = Ipv4Addr::from([13u8, 12u8, 11u8, 10u8]);
assert_eq!(Ipv4Addr::new(13, 12, 11, 10), addr);

Copies this address to a new IpAddr::V6.

Examples
use std::net::{IpAddr, Ipv6Addr};

let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff);

assert_eq!(
    IpAddr::V6(addr),
    IpAddr::from(addr)
);

Converts an Ipv4Addr into a host byte order u32.

Examples
use std::net::Ipv4Addr;

let addr = Ipv4Addr::new(0xca, 0xfe, 0xba, 0xbe);
assert_eq!(0xcafebabe, u32::from(addr));

Converts an OsString into a PathBuf

This conversion does not allocate or copy memory.

Converts a Box<Path> into a PathBuf

This conversion does not allocate or copy memory.

Converts a PathBuf into an OsString

This conversion does not allocate or copy memory.

Converts a RecvError into a TryRecvError.

This conversion always returns TryRecvError::Disconnected.

No data is allocated on the heap.

Converts a SocketAddrV6 into a SocketAddr::V6.

Creates an IpAddr::V4 from a four element byte array.

Examples
use std::net::{IpAddr, Ipv4Addr};

let addr = IpAddr::from([13u8, 12u8, 11u8, 10u8]);
assert_eq!(IpAddr::V4(Ipv4Addr::new(13, 12, 11, 10)), addr);

Creates a new instance of an RwLock<T> which is unlocked. This is equivalent to RwLock::new.

Converts a CString into an Arc<CStr> without copying or allocating.

Converts a ChildStdout into a Stdio

Examples

ChildStdout will be converted to Stdio using Stdio::from under the hood.

use std::process::{Command, Stdio};

let hello = Command::new("echo")
    .arg("Hello, world!")
    .stdout(Stdio::piped())
    .spawn()
    .expect("failed echo command");

let reverse = Command::new("rev")
    .stdin(hello.stdout.unwrap())  // Converted into a Stdio here
    .output()
    .expect("failed reverse command");

assert_eq!(reverse.stdout, b"!dlrow ,olleH\n");

Create a new cell with its contents set to value.

Example
#![feature(once_cell)]

use std::lazy::SyncOnceCell;

let a = SyncOnceCell::from(3);
let b = SyncOnceCell::new();
b.set(3)?;
assert_eq!(a, b);
Ok(())

Converts a PathBuf into an Arc by moving the PathBuf data into a new Arc buffer.

Converts a NulError into a io::Error.

Converts a File into a Stdio

Examples

File will be converted to Stdio using Stdio::from under the hood.

use std::fs::File;
use std::process::Command;

// With the `foo.txt` file containing `Hello, world!"
let file = File::open("foo.txt").unwrap();

let reverse = Command::new("rev")
    .stdin(file)  // Implicit File conversion into a Stdio
    .output()
    .expect("failed reverse command");

assert_eq!(reverse.stdout, b"!dlrow ,olleH");

Converts a borrowed OsStr to a PathBuf.

Allocates a PathBuf and copies the data into it.

Converts a SendError<T> into a TrySendError<T>.

This conversion always returns a TrySendError::Disconnected containing the data in the SendError<T>.

No data is allocated on the heap.

Converts a Vec<NonZeroU8> into a CString without copying nor checking for inner null bytes.

Converts a tuple struct (Into<IpAddr>, u16) into a SocketAddr.

This conversion creates a SocketAddr::V4 for an IpAddr::V4 and creates a SocketAddr::V6 for an IpAddr::V6.

u16 is treated as port of the newly created SocketAddr.

Converts a host byte order u32 into an Ipv4Addr.

Examples
use std::net::Ipv4Addr;

let addr = Ipv4Addr::from(0xcafebabe);
assert_eq!(Ipv4Addr::new(0xca, 0xfe, 0xba, 0xbe), addr);

Converts a Box<CStr> into a CString without copying or allocating.

Converts a SocketAddrV4 into a SocketAddr::V4.

Converts a clone-on-write pointer to an owned path.

Converting from a Cow::Owned does not clone or allocate.

Converts a String into an OsString.

This conversion does not allocate or copy memory.

Converts an OsString into an Arc<OsStr> without copying or allocating.

Converts a Path into an Arc by copying the Path data into a new Arc buffer.

Converts a Box<OsStr> into an OsString without copying or allocating.

Convert an Ipv6Addr into a host byte order u128.

Examples
use std::net::Ipv6Addr;

let addr = Ipv6Addr::new(
    0x1020, 0x3040, 0x5060, 0x7080,
    0x90A0, 0xB0C0, 0xD0E0, 0xF00D,
);
assert_eq!(0x102030405060708090A0B0C0D0E0F00D_u128, u128::from(addr));

Converts a String into a PathBuf

This conversion does not allocate or copy memory.

Copies this address to a new IpAddr::V4.

Examples
use std::net::{IpAddr, Ipv4Addr};

let addr = Ipv4Addr::new(127, 0, 0, 1);

assert_eq!(
    IpAddr::V4(addr),
    IpAddr::from(addr)
)

Creates a new mutex in an unlocked state ready for use. This is equivalent to Mutex::new.

Converts a CString into an Rc<CStr> without copying or allocating.

Converts a ChildStderr into a Stdio

Examples
use std::process::{Command, Stdio};

let reverse = Command::new("rev")
    .arg("non_existing_file.txt")
    .stderr(Stdio::piped())
    .spawn()
    .expect("failed reverse command");

let cat = Command::new("cat")
    .arg("-")
    .stdin(reverse.stderr.unwrap()) // Converted into a Stdio here
    .output()
    .expect("failed echo command");

assert_eq!(
    String::from_utf8_lossy(&cat.stdout),
    "rev: cannot open non_existing_file.txt: No such file or directory\n"
);

Converts a PathBuf into an Rc by moving the PathBuf data into a new Rc buffer.

Intended for use for errors not exposed to the user, where allocating onto the heap (for normal construction via Error::new) is too costly.

Converts an ErrorKind into an Error.

This conversion allocates a new error with a simple representation of error kind.

Examples
use std::io::{Error, ErrorKind};

let not_found = ErrorKind::NotFound;
let error = Error::from(not_found);
assert_eq!("entity not found", format!("{}", error));

Creates an Ipv6Addr from a sixteen element byte array.

Examples
use std::net::Ipv6Addr;

let addr = Ipv6Addr::from([
    25u8, 24u8, 23u8, 22u8, 21u8, 20u8, 19u8, 18u8,
    17u8, 16u8, 15u8, 14u8, 13u8, 12u8, 11u8, 10u8,
]);
assert_eq!(
    Ipv6Addr::new(
        0x1918, 0x1716,
        0x1514, 0x1312,
        0x1110, 0x0f0e,
        0x0d0c, 0x0b0a
    ),
    addr
);

Creates an IpAddr::V6 from a sixteen element byte array.

Examples
use std::net::{IpAddr, Ipv6Addr};

let addr = IpAddr::from([
    25u8, 24u8, 23u8, 22u8, 21u8, 20u8, 19u8, 18u8,
    17u8, 16u8, 15u8, 14u8, 13u8, 12u8, 11u8, 10u8,
]);
assert_eq!(
    IpAddr::V6(Ipv6Addr::new(
        0x1918, 0x1716,
        0x1514, 0x1312,
        0x1110, 0x0f0e,
        0x0d0c, 0x0b0a
    )),
    addr
);

Converts an OsString into an Rc<OsStr> without copying or allocating.

Converts a ChildStdin into a Stdio

Examples

ChildStdin will be converted to Stdio using Stdio::from under the hood.

use std::process::{Command, Stdio};

let reverse = Command::new("rev")
    .stdin(Stdio::piped())
    .spawn()
    .expect("failed reverse command");

let _echo = Command::new("echo")
    .arg("Hello, world!")
    .stdout(reverse.stdin.unwrap()) // Converted into a Stdio here
    .output()
    .expect("failed echo command");

// "!dlrow ,olleH" echoed to console

Converts a Path into an Rc by copying the Path data into a new Rc buffer.

Converts an i16 into an AtomicI16.

Converts i8 to i64 losslessly.

Converts NonZeroI16 to NonZeroIsize losslessly.

Converts a NonZeroUsize into an usize

Converts a bool to a i16. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(i16::from(true), 1);
assert_eq!(i16::from(false), 0);

Converts a [char] into a [u128].

Examples
use std::mem;

let c = '⚙';
let u = u128::from(c);
assert!(16 == mem::size_of_val(&u))

Converts a bool to a i8. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(i8::from(true), 1);
assert_eq!(i8::from(false), 0);

Converts u8 to i16 losslessly.

Converts u16 to f64 losslessly.

Converts NonZeroI64 to NonZeroI128 losslessly.

Converts NonZeroI16 to NonZeroI64 losslessly.

Converts NonZeroU8 to NonZeroU128 losslessly.

Converts NonZeroI32 to NonZeroI64 losslessly.

Converts i8 to f64 losslessly.

Converts u32 to i128 losslessly.

Converts a bool to a i128. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(i128::from(true), 1);
assert_eq!(i128::from(false), 0);

Converts NonZeroU16 to NonZeroI32 losslessly.

Converts u16 to f32 losslessly.

Converts NonZeroU32 to NonZeroI128 losslessly.

Converts a NonZeroIsize into an isize

Converts a NonZeroU16 into an u16

Converts an i8 into an AtomicI8.

Converts an usize into an AtomicUsize.

Converts NonZeroI32 to NonZeroI128 losslessly.

Converts NonZeroU8 to NonZeroU64 losslessly.

Converts a NonZeroI8 into an i8

Converts NonZeroU16 to NonZeroU64 losslessly.

Converts NonZeroU8 to NonZeroI16 losslessly.

Converts u8 to i32 losslessly.

Converts a bool to a i64. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(i64::from(true), 1);
assert_eq!(i64::from(false), 0);

Converts NonZeroU8 to NonZeroI64 losslessly.

Converts i32 to f64 losslessly.

Converts NonZeroU16 to NonZeroU32 losslessly.

Converts NonZeroU8 to NonZeroIsize losslessly.

Converts NonZeroI8 to NonZeroIsize losslessly.

Converts u8 to isize losslessly.

Converts a NonZeroU64 into an u64

Converts f32 to f64 losslessly.

Converts an u32 into an AtomicU32.

Converts NonZeroU16 to NonZeroUsize losslessly.

Converts i64 to i128 losslessly.

Converts i8 to isize losslessly.

Converts i16 to i32 losslessly.

Converts i16 to i64 losslessly.

Converts u64 to u128 losslessly.

Converts an u8 into an AtomicU8.

Converts NonZeroU32 to NonZeroU128 losslessly.

Converts i16 to f32 losslessly.

Converts a NonZeroI64 into an i64

Converts a NonZeroU128 into an u128

Converts u16 to u128 losslessly.

Converts NonZeroU64 to NonZeroI128 losslessly.

Converts NonZeroI8 to NonZeroI64 losslessly.

Converts NonZeroU8 to NonZeroI32 losslessly.

Converts a bool to a usize. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(usize::from(true), 1);
assert_eq!(usize::from(false), 0);

Converts a [char] into a [u32].

Examples
use std::mem;

let c = 'c';
let u = u32::from(c);
assert!(4 == mem::size_of_val(&u))

Converts u32 to u128 losslessly.

Converts u32 to i64 losslessly.

Converts i16 to i128 losslessly.

Converts a bool to a isize. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(isize::from(true), 1);
assert_eq!(isize::from(false), 0);

Converts u16 to u64 losslessly.

Converts a bool to a u32. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(u32::from(true), 1);
assert_eq!(u32::from(false), 0);

Converts i8 to i32 losslessly.

Converts u8 to usize losslessly.

Converts u8 to u32 losslessly.

Converts an isize into an AtomicIsize.

Converts a bool to a u128. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(u128::from(true), 1);
assert_eq!(u128::from(false), 0);

Converts a NonZeroI32 into an i32

Converts i32 to i128 losslessly.

Converts NonZeroU16 to NonZeroU128 losslessly.

Converts u8 to u64 losslessly.

Converts a NonZeroU32 into an u32

Converts u16 to i64 losslessly.

Converts u16 to usize losslessly.

Convert to a Ready variant.

Example
assert_eq!(Poll::from(true), Poll::Ready(true));

Maps a byte in 0x00..=0xFF to a char whose code point has the same value, in U+0000..=U+00FF.

Unicode is designed such that this effectively decodes bytes with the character encoding that IANA calls ISO-8859-1. This encoding is compatible with ASCII.

Note that this is different from ISO/IEC 8859-1 a.k.a. ISO 8859-1 (with one less hyphen), which leaves some “blanks”, byte values that are not assigned to any character. ISO-8859-1 (the IANA one) assigns them to the C0 and C1 control codes.

Note that this is also different from Windows-1252 a.k.a. code page 1252, which is a superset ISO/IEC 8859-1 that assigns some (not all!) blanks to punctuation and various Latin characters.

To confuse things further, on the Web ascii, iso-8859-1, and windows-1252 are all aliases for a superset of Windows-1252 that fills the remaining blanks with corresponding C0 and C1 control codes.

Converts a u8 into a [char].

Examples
use std::mem;

let u = 32 as u8;
let c = char::from(u);
assert!(4 == mem::size_of_val(&c))

Converts a NonZeroI128 into an i128

Converts u64 to i128 losslessly.

Converts NonZeroI16 to NonZeroI32 losslessly.

Converts u8 to i128 losslessly.

Converts a bool to a i32. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(i32::from(true), 1);
assert_eq!(i32::from(false), 0);

Converts i16 to f64 losslessly.

Converts a bool into an AtomicBool.

Examples
use std::sync::atomic::AtomicBool;
let atomic_bool = AtomicBool::from(true);
assert_eq!(format!("{:?}", atomic_bool), "true")

Converts i32 to i64 losslessly.

Converts i8 to f32 losslessly.

Converts u8 to u128 losslessly.

Converts NonZeroU8 to NonZeroU16 losslessly.

Converts a bool to a u64. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(u64::from(true), 1);
assert_eq!(u64::from(false), 0);

Converts u16 to i32 losslessly.

Converts i8 to i16 losslessly.

Converts an i64 into an AtomicI64.

Converts NonZeroI8 to NonZeroI16 losslessly.

Converts NonZeroI8 to NonZeroI128 losslessly.

Converts u8 to f32 losslessly.

Converts a NonZeroU8 into an u8

Converts an u64 into an AtomicU64.

Converts NonZeroU16 to NonZeroI128 losslessly.

Converts u32 to f64 losslessly.

Converts u8 to u16 losslessly.

Converts i16 to isize losslessly.

Converts a bool to a u16. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(u16::from(true), 1);
assert_eq!(u16::from(false), 0);

Converts NonZeroU8 to NonZeroI128 losslessly.

Converts a bool to a u8. The resulting value is 0 for false and 1 for true values.

Examples
assert_eq!(u8::from(true), 1);
assert_eq!(u8::from(false), 0);

Converts NonZeroU8 to NonZeroUsize losslessly.

Converts i8 to i128 losslessly.

Converts u8 to i64 losslessly.

Converts NonZeroI8 to NonZeroI32 losslessly.

Converts u8 to f64 losslessly.

Converts an u16 into an AtomicU16.

Converts NonZeroU32 to NonZeroI64 losslessly.

Converts NonZeroU32 to NonZeroU64 losslessly.

Converts NonZeroU8 to NonZeroU32 losslessly.

Converts NonZeroU64 to NonZeroU128 losslessly.

Converts a [char] into a [u64].

Examples
use std::mem;

let c = '👤';
let u = u64::from(c);
assert!(8 == mem::size_of_val(&u))

Converts an i32 into an AtomicI32.

Converts NonZeroU16 to NonZeroI64 losslessly.

Converts u16 to i128 losslessly.

Converts u16 to u32 losslessly.

Converts u32 to u64 losslessly.

Converts a NonZeroI16 into an i16

Converts NonZeroI16 to NonZeroI128 losslessly.

Use a Wake-able type as a Waker.

No heap allocations or atomic operations are used for this conversion.

Converts a T into an Arc<T>

The conversion moves the value into a newly allocated Arc. It is equivalent to calling Arc::new(t).

Example
let x = 5;
let arc = Arc::new(5);

assert_eq!(Arc::from(x), arc);

Create an atomically reference-counted pointer from a clone-on-write pointer by copying its content.

Example
let cow: Cow<str> = Cow::Borrowed("eggplant");
let shared: Arc<str> = Arc::from(cow);
assert_eq!("eggplant", &shared[..]);

Allocate a reference-counted string slice and copy v into it.

Example
let shared: Rc<str> = Rc::from("statue");
assert_eq!("statue", &shared[..]);

Allocate a reference-counted slice and move v’s items into it.

Example
let original: Box<Vec<i32>> = Box::new(vec![1, 2, 3]);
let shared: Rc<Vec<i32>> = Rc::from(original);
assert_eq!(vec![1, 2, 3], *shared);

Allocate a reference-counted str and copy v into it.

Example
let shared: Arc<str> = Arc::from("eggplant");
assert_eq!("eggplant", &shared[..]);

Allocate a reference-counted slice and fill it by cloning v’s items.

Example
let original: &[i32] = &[1, 2, 3];
let shared: Rc<[i32]> = Rc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);

Use a Wake-able type as a RawWaker.

No heap allocations or atomic operations are used for this conversion.

Allocate a reference-counted slice and move v’s items into it.

Example
let unique: Vec<i32> = vec![1, 2, 3];
let shared: Arc<[i32]> = Arc::from(unique);
assert_eq!(&[1, 2, 3], &shared[..]);

Allocate a reference-counted string slice and copy v into it.

Example
let original: String = "statue".to_owned();
let shared: Rc<str> = Rc::from(original);
assert_eq!("statue", &shared[..]);

Create a reference-counted pointer from a clone-on-write pointer by copying its content.

Example
let cow: Cow<str> = Cow::Borrowed("eggplant");
let shared: Rc<str> = Rc::from(cow);
assert_eq!("eggplant", &shared[..]);

Converts a Box<T> into a Pin<Box<T>>

This conversion does not allocate on the heap and happens in place.

Move a boxed object to a new, reference-counted allocation.

Example
let unique: Box<str> = Box::from("eggplant");
let shared: Arc<str> = Arc::from(unique);
assert_eq!("eggplant", &shared[..]);

Allocate a reference-counted str and copy v into it.

Example
let unique: String = "eggplant".to_owned();
let shared: Arc<str> = Arc::from(unique);
assert_eq!("eggplant", &shared[..]);

Allocate a reference-counted slice and fill it by cloning v’s items.

Example
let original: &[i32] = &[1, 2, 3];
let shared: Arc<[i32]> = Arc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);

Move a boxed object to a new, reference counted, allocation.

Example
let original: Box<i32> = Box::new(1);
let shared: Rc<i32> = Rc::from(original);
assert_eq!(1, *shared);

Converts a generic type T into an Rc<T>

The conversion allocates on the heap and moves t from the stack into it.

Example
let x = 5;
let rc = Rc::new(5);

assert_eq!(Rc::from(x), rc);

Create an ArrayVec from an array.

use arrayvec::ArrayVec;

let mut array = ArrayVec::from([1, 2, 3]);
assert_eq!(array.len(), 3);
assert_eq!(array.capacity(), 3);

Implementors

Stability note: This impl does not yet exist, but we are “reserving space” to add it in the future. See rust-lang/rust#64715 for details.

impl<A: Array> From<A> for ArrayVec<A>

impl<'a> From<&'a str> for &'a Utf8Path

impl<T: ?Sized + AsRef<str>> From<&'_ T> for Utf8PathBuf

impl<T: ?Sized + AsRef<str>> From<&'_ T> for Box<Utf8Path>

impl From<&'_ Utf8Path> for Arc<Utf8Path>

impl From<&'_ Utf8Path> for Rc<Utf8Path>

impl<'a> From<&'a Utf8Path> for Cow<'a, Utf8Path>

impl From<&'_ Utf8Path> for Box<Path>

impl From<&'_ Utf8Path> for Arc<Path>

impl From<&'_ Utf8Path> for Rc<Path>

impl<'a> From<&'a Utf8Path> for Cow<'a, Path>

impl<'a> From<Cow<'a, Utf8Path>> for Utf8PathBuf

impl<'a> From<Utf8PathBuf> for Cow<'a, Utf8Path>

impl From<Utf8PathBuf> for Rc<Path>

impl<'a> From<Utf8PathBuf> for Cow<'a, Path>

impl From<Error> for Error

impl From<Utf8Error> for Error

impl From<Error> for Error

impl<Tz: TimeZone> From<DateTime<Tz>> for SystemTime

impl<'help> From<&'help str> for PossibleValue<'help>

impl<'help> From<&'help &'help str> for PossibleValue<'help>

impl<'help> From<&'_ Arg<'help>> for Arg<'help>

impl<'help> From<&'_ ArgGroup<'help>> for ArgGroup<'help>

impl From<Error> for Error

impl From<Error> for Error

impl<'a> From<&'a str> for FileSourceString

impl<'a> From<&'a Path> for File<FileSourceFile>

impl<T> From<T> for Value where
    T: Into<ValueKind>, 

impl<T> From<SendError<T>> for TrySendError<T>

impl<T> From<SendError<T>> for SendTimeoutError<T>

impl<T: ?Sized + Pointable> From<Owned<T>> for Atomic<T>

impl<T> From<Box<T, Global>> for Atomic<T>

impl<T> From<T> for Atomic<T>

impl<'g, T: ?Sized + Pointable> From<Shared<'g, T>> for Atomic<T>

impl<T> From<*const T> for Atomic<T>

impl<T> From<T> for Owned<T>

impl<T> From<Box<T, Global>> for Owned<T>

impl<T> From<*const T> for Shared<'_, T>

impl<T> From<T> for AtomicCell<T>

impl<T> From<T> for CachePadded<T>

impl<T> From<T> for ShardedLock<T>

impl From<Errno> for Error

impl<'a> From<&'a Expression> for Expression

impl<L, R> From<Result<R, L>> for Either<L, R>

impl<'a, T> From<T> for Env<'a> where
    T: Into<Cow<'a, str>>, 

impl<E> From<E> for Report where
    E: StdError + Send + Sync + 'static, 

impl From<Report> for Box<dyn StdError + Send + Sync + 'static>

impl From<Report> for Box<dyn StdError + 'static>

impl<T> From<T> for DebugFrameOffset<T>

impl<T> From<T> for EhFrameOffset<T>

impl<R> From<R> for DebugAddr<R>

impl<R: Reader> From<R> for DebugFrame<R>

impl<R: Reader> From<R> for EhFrameHdr<R>

impl<R: Reader> From<R> for EhFrame<R>

impl<R> From<R> for DebugAbbrev<R>

impl<R> From<R> for DebugAranges<R>

impl<R> From<R> for DebugCuIndex<R>

impl<R> From<R> for DebugTuIndex<R>

impl<R> From<R> for DebugLine<R>

impl<R> From<R> for DebugLoc<R>

impl<R> From<R> for DebugLocLists<R>

impl<R: Reader> From<R> for DebugPubNames<R>

impl<R: Reader> From<R> for DebugPubTypes<R>

impl<R> From<R> for DebugRanges<R>

impl<R> From<R> for DebugRngLists<R>

impl<R> From<R> for DebugStr<R>

impl<R> From<R> for DebugStrOffsets<R>

impl<R> From<R> for DebugLineStr<R>

impl<R> From<R> for DebugInfo<R>

impl<R> From<R> for DebugTypes<R>

impl<'g> From<(&'g PackageId, &'g str)> for FeatureId<'g>

impl<'g> From<(&'g PackageId, Option<&'g str>)> for FeatureId<'g>

impl<'g> From<FeatureId<'g>> for (PackageId, Option<String>)

impl<T: Into<Arc<Platform>>> From<T> for PlatformSpec

impl<T, S, A> From<HashMap<T, (), S, A>> for HashSet<T, S, A> where
    A: Allocator + Clone

impl<T> From<T> for Serde<T>

impl<K, V, const N: usize> From<[(K, V); N]> for IndexMap<K, V, RandomState> where
    K: Hash + Eq

impl<T, const N: usize> From<[T; N]> for IndexSet<T, RandomState> where
    T: Eq + Hash

impl<A: IntoIterator> From<(A,)> for Zip<(A::IntoIter,)>

impl<A: IntoIterator, B: IntoIterator> From<(A, B)> for Zip<(A::IntoIter, B::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator> From<(A, B, C)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator, D: IntoIterator> From<(A, B, C, D)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter, D::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator, D: IntoIterator, E: IntoIterator> From<(A, B, C, D, E)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter, D::IntoIter, E::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator, D: IntoIterator, E: IntoIterator, F: IntoIterator> From<(A, B, C, D, E, F)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter, D::IntoIter, E::IntoIter, F::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator, D: IntoIterator, E: IntoIterator, F: IntoIterator, G: IntoIterator> From<(A, B, C, D, E, F, G)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter, D::IntoIter, E::IntoIter, F::IntoIter, G::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator, D: IntoIterator, E: IntoIterator, F: IntoIterator, G: IntoIterator, H: IntoIterator> From<(A, B, C, D, E, F, G, H)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter, D::IntoIter, E::IntoIter, F::IntoIter, G::IntoIter, H::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator, D: IntoIterator, E: IntoIterator, F: IntoIterator, G: IntoIterator, H: IntoIterator, I: IntoIterator> From<(A, B, C, D, E, F, G, H, I)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter, D::IntoIter, E::IntoIter, F::IntoIter, G::IntoIter, H::IntoIter, I::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator, D: IntoIterator, E: IntoIterator, F: IntoIterator, G: IntoIterator, H: IntoIterator, I: IntoIterator, J: IntoIterator> From<(A, B, C, D, E, F, G, H, I, J)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter, D::IntoIter, E::IntoIter, F::IntoIter, G::IntoIter, H::IntoIter, I::IntoIter, J::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator, D: IntoIterator, E: IntoIterator, F: IntoIterator, G: IntoIterator, H: IntoIterator, I: IntoIterator, J: IntoIterator, K: IntoIterator> From<(A, B, C, D, E, F, G, H, I, J, K)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter, D::IntoIter, E::IntoIter, F::IntoIter, G::IntoIter, H::IntoIter, I::IntoIter, J::IntoIter, K::IntoIter)>

impl<A: IntoIterator, B: IntoIterator, C: IntoIterator, D: IntoIterator, E: IntoIterator, F: IntoIterator, G: IntoIterator, H: IntoIterator, I: IntoIterator, J: IntoIterator, K: IntoIterator, L: IntoIterator> From<(A, B, C, D, E, F, G, H, I, J, K, L)> for Zip<(A::IntoIter, B::IntoIter, C::IntoIter, D::IntoIter, E::IntoIter, F::IntoIter, G::IntoIter, H::IntoIter, I::IntoIter, J::IntoIter, K::IntoIter, L::IntoIter)>

impl From<ErrorCode> for Error

impl From<&'_ StreamResult> for MZResult

impl From<Errno> for Error

impl<'a> From<&'a sigevent> for SigEvent

impl From<termios> for Termios

impl From<Termios> for termios

impl From<timeval> for TimeVal

impl From<i32> for ClockId

impl From<Uid> for uid_t

impl From<Gid> for gid_t

impl From<Pid> for pid_t

impl From<&'_ passwd> for User

impl From<User> for passwd

impl From<&'_ group> for Group

impl<E: Endian> From<Rel32<E>> for Rela32<E>

impl<E: Endian> From<Rel64<E>> for Rela64<E>

impl<T> From<T> for OnceCell<T>

impl<T> From<T> for OnceCell<T>

impl<'a> From<&'a RawOsStr> for Cow<'a, RawOsStr>

impl From<RawOsString> for Cow<'_, RawOsStr>

impl From<u8> for XtermColors

impl From<XtermColors> for u8

impl<'a> From<&'a str> for AnsiColors

impl<Ix: IndexType> From<Ix> for NodeIndex<Ix>

impl<Ix: IndexType> From<Ix> for EdgeIndex<Ix>

impl From<Span> for Span

impl From<Group> for TokenTree

impl From<Ident> for TokenTree

impl From<Punct> for TokenTree

impl<T> From<(T, T)> for Property where
    T: Into<String>, 

impl From<Output> for String

impl From<Error> for Error

impl From<Utf8Error> for Error

impl<'a> From<(&'a [u8], &'a [u8])> for Attribute<'a>

impl<'a> From<(&'a str, &'a str)> for Attribute<'a>

impl<'t> From<Match<'t>> for Range<usize>

impl<'t> From<Match<'t>> for &'t str

impl<'t> From<Match<'t>> for Range<usize>

impl From<Error> for Error

impl From<Error> for Error

impl From<Error> for Error

impl From<i8> for Value

impl From<i16> for Value

impl From<i32> for Value

impl From<i64> for Value

impl From<isize> for Value

impl From<u8> for Value

impl From<u16> for Value

impl From<u32> for Value

impl From<u64> for Value

impl From<usize> for Value

impl From<f32> for Value

impl From<f64> for Value

impl From<bool> for Value

impl From<String> for Value

impl<'a> From<&'a str> for Value

impl<'a> From<Cow<'a, str>> for Value

impl From<Number> for Value

impl From<Map<String, Value>> for Value

impl<T: Into<Value>> From<Vec<T, Global>> for Value

impl<'a, T: Clone + Into<Value>> From<&'a [T]> for Value

impl From<()> for Value

impl From<u8> for Number

impl From<u16> for Number

impl From<u32> for Number

impl From<u64> for Number

impl From<usize> for Number

impl From<i8> for Number

impl From<i16> for Number

impl From<i32> for Number

impl From<i64> for Number

impl From<isize> for Number

impl<'a, A: Array> From<&'a [<A as Array>::Item]> for SmallVec<A> where
    A::Item: Clone

impl<A: Array> From<Vec<<A as Array>::Item, Global>> for SmallVec<A>

impl<A: Array> From<A> for SmallVec<A>

impl From<SelfValue> for Ident

impl From<SelfType> for Ident

impl From<Super> for Ident

impl From<Crate> for Ident

impl From<Extern> for Ident

impl From<Path> for Meta

impl From<MetaList> for Meta

impl From<Meta> for NestedMeta

impl From<Lit> for NestedMeta

impl From<ExprArray> for Expr

impl From<ExprAssign> for Expr

impl From<ExprAsync> for Expr

impl From<ExprAwait> for Expr

impl From<ExprBinary> for Expr

impl From<ExprBlock> for Expr

impl From<ExprBox> for Expr

impl From<ExprBreak> for Expr

impl From<ExprCall> for Expr

impl From<ExprCast> for Expr

impl From<ExprField> for Expr

impl From<ExprGroup> for Expr

impl From<ExprIf> for Expr

impl From<ExprIndex> for Expr

impl From<ExprLet> for Expr

impl From<ExprLit> for Expr

impl From<ExprLoop> for Expr

impl From<ExprMacro> for Expr

impl From<ExprMatch> for Expr

impl From<ExprParen> for Expr

impl From<ExprPath> for Expr

impl From<ExprRange> for Expr

impl From<ExprRepeat> for Expr

impl From<ExprReturn> for Expr

impl From<ExprStruct> for Expr

impl From<ExprTry> for Expr

impl From<ExprTuple> for Expr

impl From<ExprType> for Expr

impl From<ExprUnary> for Expr

impl From<ExprUnsafe> for Expr

impl From<ExprWhile> for Expr

impl From<ExprYield> for Expr

impl From<Ident> for Member

impl From<Index> for Member

impl From<usize> for Member

impl From<usize> for Index

impl From<Ident> for TypeParam

impl From<ItemConst> for Item

impl From<ItemEnum> for Item

impl From<ItemFn> for Item

impl From<ItemImpl> for Item

impl From<ItemMacro> for Item

impl From<ItemMacro2> for Item

impl From<ItemMod> for Item

impl From<ItemStatic> for Item

impl From<ItemStruct> for Item

impl From<ItemTrait> for Item

impl From<ItemType> for Item

impl From<ItemUnion> for Item

impl From<ItemUse> for Item

impl From<UsePath> for UseTree

impl From<UseName> for UseTree

impl From<UseGlob> for UseTree

impl From<Receiver> for FnArg

impl From<PatType> for FnArg

impl From<LitStr> for Lit

impl From<LitByteStr> for Lit

impl From<LitByte> for Lit

impl From<LitChar> for Lit

impl From<LitInt> for Lit

impl From<LitFloat> for Lit

impl From<LitBool> for Lit

impl From<Literal> for LitInt

impl From<DataStruct> for Data

impl From<DataEnum> for Data

impl From<DataUnion> for Data

impl From<TypeArray> for Type

impl From<TypeBareFn> for Type

impl From<TypeGroup> for Type

impl From<TypeInfer> for Type

impl From<TypeMacro> for Type

impl From<TypeNever> for Type

impl From<TypeParen> for Type

impl From<TypePath> for Type

impl From<TypePtr> for Type

impl From<TypeSlice> for Type

impl From<TypeTuple> for Type

impl From<PatBox> for Pat

impl From<PatIdent> for Pat

impl From<PatLit> for Pat

impl From<PatMacro> for Pat

impl From<PatOr> for Pat

impl From<PatPath> for Pat

impl From<PatRange> for Pat

impl From<PatRest> for Pat

impl From<PatSlice> for Pat

impl From<PatStruct> for Pat

impl From<PatTuple> for Pat

impl From<PatType> for Pat

impl From<PatWild> for Pat

impl<T> From<T> for Path where
    T: Into<PathSegment>, 

impl<T> From<T> for PathSegment where
    T: Into<Ident>, 

impl From<LexError> for Error

impl<'a, WrapAlgo, WordSep, WordSplit> From<&'a Options<'a, WrapAlgo, WordSep, WordSplit>> for Options<'a, WrapAlgo, WordSep, WordSplit> where
    WrapAlgo: Clone,
    WordSep: Clone,
    WordSplit: Clone

impl<'a> From<&'a str> for Value

impl<V: Into<Value>> From<Vec<V, Global>> for Value

impl<S: Into<String>, V: Into<Value>> From<BTreeMap<S, V>> for Value

impl<S: Into<String> + Hash + Eq, V: Into<Value>> From<HashMap<S, V, RandomState>> for Value

impl From<String> for Value

impl From<i64> for Value

impl From<i32> for Value

impl From<i8> for Value

impl From<u8> for Value

impl From<u32> for Value

impl From<f64> for Value

impl From<f32> for Value

impl From<bool> for Value

impl From<Datetime> for Value

impl From<Map<String, Value>> for Value

impl From<Error> for Error

impl From<Error> for Error