pub trait From<T>: Sized {
// Required method
fn from(value: 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 From
when specifying trait bounds on a generic function
to ensure that types that only implement Into
can be used as well.
The From
trait 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>
.
From
simplifies error handling by allowing a function to return a single error type
that encapsulates multiple error types. See the “Examples” section and the book for more
details.
Note: This trait must not fail. The From
trait is intended for perfect conversions.
If the conversion can fail or is not perfect, use TryFrom
.
§Generic Implementations
From<T> for U
impliesInto
<U> for T
From
is reflexive, which means thatFrom<T> for T
is implemented
§When to implement From
While there’s no technical restrictions on which conversions can be done using
a From
implementation, the general expectation is that the conversions
should typically be restricted as follows:
-
The conversion is infallible: if the conversion can fail, use
TryFrom
instead; don’t provide aFrom
impl that panics. -
The conversion is lossless: semantically, it should not lose or discard information. For example,
i32: From<u16>
exists, where the original value can be recovered usingu16: TryFrom<i32>
. AndString: From<&str>
exists, where you can get something equivalent to the original value viaDeref
. ButFrom
cannot be used to convert fromu32
tou16
, since that cannot succeed in a lossless way. (There’s some wiggle room here for information not considered semantically relevant. For example,Box<[T]>: From<Vec<T>>
exists even though it might not preserve capacity, like how two vectors can be equal despite differing capacities.) -
The conversion is value-preserving: the conceptual kind and meaning of the resulting value is the same, even though the Rust type and technical representation might be different. For example
-1_i8 as u8
is lossless, sinceas
casting back can recover the original value, but that conversion is not available viaFrom
because-1
and255
are different conceptual values (despite being identical bit patterns technically). Butf32: From<i16>
is available because1_i16
and1.0_f32
are conceptually the same real number (despite having very different bit patterns technically).String: From<char>
is available because they’re both text, butString: From<u32>
is not available, since1
(a number) and"1"
(text) are too different. (Converting values to text is instead covered by theDisplay
trait.) -
The conversion is obvious: it’s the only reasonable conversion between the two types. Otherwise it’s better to have it be a named method or constructor, like how
str::as_bytes
is a method and how integers have methods likeu32::from_ne_bytes
,u32::from_le_bytes
, andu32::from_be_bytes
, none of which areFrom
implementations. Whereas there’s only one reasonable way to wrap anIpv6Addr
into anIpAddr
, thusIpAddr: From<Ipv6Addr>
exists.
§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 with From::from
.
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§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl From<&'static str> for Bytes
impl From<&'static [u8]> for Bytes
impl From<&TimecatError> for TimecatError
impl From<&Endian> for String
impl From<&Styles> for Style
impl From<&str> for TimecatError
impl From<&str> for Color
impl From<&str> for Value
impl From<&str> for Box<str>
impl From<&str> for Rc<str>
impl From<&str> for String
impl From<&str> for Vec<u8>
impl From<&str> for Arc<str>
impl From<&u64> for BitBoard
impl From<&ChessPosition> for Board
impl From<&ChessPosition> for ChessPositionBuilder
impl From<&String> for String
impl From<&CStr> for Box<CStr>
impl From<&CStr> for CString
impl From<&CStr> for Rc<CStr>
impl From<&CStr> for Arc<CStr>
impl From<&OsStr> for Box<OsStr>
impl From<&OsStr> for Rc<OsStr>
impl From<&OsStr> for Arc<OsStr>
impl From<&Number> for f64
impl From<&Path> for Box<Path>
impl From<&Path> for Rc<Path>
impl From<&Path> for Arc<Path>
impl From<&BitBoard> for u64
impl From<&Move> for ValidOrNullMove
impl From<&mut str> for Box<str>
impl From<&mut str> for Rc<str>
impl From<&mut str> for String
impl From<&mut str> for Arc<str>
impl From<&mut CStr> for Box<CStr>
impl From<&mut CStr> for Rc<CStr>
impl From<&mut CStr> for Arc<CStr>
impl From<&mut OsStr> for Box<OsStr>
impl From<&mut OsStr> for Rc<OsStr>
impl From<&mut OsStr> for Arc<OsStr>
impl From<&mut Path> for Box<Path>
impl From<&mut Path> for Rc<Path>
impl From<&mut Path> for Arc<Path>
impl From<(u8, u8, u8)> for CustomColor
impl From<Pyo3Error> for PyErr
impl From<TimecatError> for String
impl From<TimecatError> for PyErr
impl From<TryLockError> for std::io::error::Error
impl From<Cow<'_, str>> for Box<str>
impl From<Cow<'_, CStr>> for Box<CStr>
impl From<Cow<'_, OsStr>> for Box<OsStr>
impl From<Cow<'_, Path>> for Box<Path>
impl From<TryReserveErrorKind> for TryReserveError
impl From<AsciiChar> for char
impl From<AsciiChar> for u8
impl From<AsciiChar> for u16
impl From<AsciiChar> for u32
impl From<AsciiChar> for u64
impl From<AsciiChar> for u128
impl From<Infallible> for TryFromSliceError
impl From<Infallible> for TryFromIntError
impl From<Infallible> for http::error::Error
impl From<Infallible> for PyErr
impl From<Option<&Move>> for ValidOrNullMove
impl From<Option<Move>> for ValidOrNullMove
impl From<ErrorKind> for std::io::error::Error
Intended for use for errors not exposed to the user, where allocating onto the heap (for normal construction via Error::new) is too costly.
impl From<Styles> for Style
impl From<Error> for HistoryError
impl From<BinaryType> for JsValue
impl From<ReferrerPolicy> for JsValue
impl From<RequestCache> for JsValue
impl From<RequestCredentials> for JsValue
impl From<RequestMode> for JsValue
impl From<RequestRedirect> for JsValue
impl From<ResponseType> for JsValue
impl From<UserCommand> for timecat::constants::types::Result<Vec<UserCommand>>
impl From<GoCommand> for SearchConfig
impl From<bool> for Value
impl From<bool> for f16
impl From<bool> for f32
impl From<bool> for f64
impl From<bool> for f128
impl From<bool> for i8
impl From<bool> for i16
impl From<bool> for i32
impl From<bool> for i64
impl From<bool> for i128
impl From<bool> for isize
impl From<bool> for u8
impl From<bool> for u16
impl From<bool> for u32
impl From<bool> for u64
impl From<bool> for u128
impl From<bool> for usize
impl From<bool> for Boolean
impl From<bool> for JsValue
impl From<bool> for AtomicBool
impl From<char> for u32
impl From<char> for u64
impl From<char> for u128
impl From<char> for String
impl From<char> for JsString
impl From<f16> for f64
impl From<f16> for f128
impl From<f32> for Value
impl From<f32> for f64
impl From<f32> for f128
impl From<f32> for js_sys::Number
impl From<f32> for JsValue
impl From<f64> for Value
impl From<f64> for f128
impl From<f64> for js_sys::Number
impl From<f64> for JsValue
impl From<i8> for Value
impl From<i8> for f16
impl From<i8> for f32
impl From<i8> for f64
impl From<i8> for f128
impl From<i8> for i16
impl From<i8> for i32
impl From<i8> for i64
impl From<i8> for i128
impl From<i8> for isize
impl From<i8> for AtomicI8
impl From<i8> for BigInt
impl From<i8> for js_sys::Number
impl From<i8> for serde_json::number::Number
impl From<i8> for JsValue
impl From<i16> for Value
impl From<i16> for f32
impl From<i16> for f64
impl From<i16> for f128
impl From<i16> for i32
impl From<i16> for i64
impl From<i16> for i128
impl From<i16> for isize
impl From<i16> for AtomicI16
impl From<i16> for HeaderValue
impl From<i16> for BigInt
impl From<i16> for js_sys::Number
impl From<i16> for serde_json::number::Number
impl From<i16> for JsValue
impl From<i32> for Value
impl From<i32> for f64
impl From<i32> for f128
impl From<i32> for i64
impl From<i32> for i128
impl From<i32> for AtomicI32
impl From<i32> for HeaderValue
impl From<i32> for BigInt
impl From<i32> for js_sys::Number
impl From<i32> for serde_json::number::Number
impl From<i32> for JsValue
impl From<i64> for Value
impl From<i64> for i128
impl From<i64> for AtomicI64
impl From<i64> for HeaderValue
impl From<i64> for BigInt
impl From<i64> for serde_json::number::Number
impl From<i64> for JsValue
impl From<i128> for BigInt
impl From<i128> for JsValue
impl From<isize> for Value
impl From<isize> for AtomicIsize
impl From<isize> for HeaderValue
impl From<isize> for BigInt
impl From<isize> for serde_json::number::Number
impl From<isize> for JsValue
impl From<!> for Infallible
impl From<!> for TryFromIntError
impl From<u8> for Value
impl From<u8> for char
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.
impl From<u8> for f16
impl From<u8> for f32
impl From<u8> for f64
impl From<u8> for f128
impl From<u8> for i16
impl From<u8> for i32
impl From<u8> for i64
impl From<u8> for i128
impl From<u8> for isize
impl From<u8> for u16
impl From<u8> for u32
impl From<u8> for u64
impl From<u8> for u128
impl From<u8> for usize
impl From<u8> for AtomicU8
impl From<u8> for ExitCode
impl From<u8> for BigInt
impl From<u8> for js_sys::Number
impl From<u8> for serde_json::number::Number
impl From<u8> for JsValue
impl From<u16> for Value
impl From<u16> for f32
impl From<u16> for f64
impl From<u16> for f128
impl From<u16> for i32
impl From<u16> for i64
impl From<u16> for i128
impl From<u16> for u32
impl From<u16> for u64
impl From<u16> for u128
impl From<u16> for usize
impl From<u16> for AtomicU16
impl From<u16> for HeaderValue
impl From<u16> for BigInt
impl From<u16> for js_sys::Number
impl From<u16> for serde_json::number::Number
impl From<u16> for JsValue
impl From<u32> for Value
impl From<u32> for f64
impl From<u32> for f128
impl From<u32> for i64
impl From<u32> for i128
impl From<u32> for u64
impl From<u32> for u128
impl From<u32> for Ipv4Addr
impl From<u32> for AtomicU32
impl From<u32> for HeaderValue
impl From<u32> for BigInt
impl From<u32> for js_sys::Number
impl From<u32> for serde_json::number::Number
impl From<u32> for JsValue
impl From<u64> for Value
impl From<u64> for i128
impl From<u64> for u128
impl From<u64> for AtomicU64
impl From<u64> for HeaderValue
impl From<u64> for BigInt
impl From<u64> for serde_json::number::Number
impl From<u64> for JsValue
impl From<u64> for BitBoard
impl From<u128> for Ipv6Addr
impl From<u128> for BigInt
impl From<u128> for JsValue
impl From<()> for Value
impl From<usize> for Value
impl From<usize> for HeaderValue
impl From<usize> for BigInt
impl From<usize> for serde_json::number::Number
impl From<usize> for JsValue
impl From<usize> for AtomicUsize
impl From<ChessPosition> for Board
impl From<ChessPosition> for ChessPositionBuilder
impl From<File> for OwnedFd
impl From<File> for Stdio
impl From<Box<str>> for String
impl From<Box<ByteStr>> for Box<[u8]>
impl From<Box<CStr>> for CString
impl From<Box<OsStr>> for OsString
impl From<Box<Path>> for PathBuf
impl From<Box<[f32]>> for JsValue
impl From<Box<[f64]>> for JsValue
impl From<Box<[i8]>> for JsValue
impl From<Box<[i16]>> for JsValue
impl From<Box<[i32]>> for JsValue
impl From<Box<[i64]>> for JsValue
impl From<Box<[u8]>> for Box<ByteStr>
impl From<Box<[u8]>> for Bytes
impl From<Box<[u8]>> for JsValue
impl From<Box<[u16]>> for JsValue
impl From<Box<[u32]>> for JsValue
impl From<Box<[u64]>> for JsValue
impl From<ByteString> for Vec<u8>
impl From<TryReserveError> for std::io::error::Error
impl From<CString> for Box<CStr>
impl From<CString> for Rc<CStr>
impl From<CString> for Vec<u8>
impl From<CString> for Arc<CStr>
impl From<IntoStringError> for PyErr
impl From<NulError> for std::io::error::Error
impl From<NulError> for PyErr
impl From<Rc<str>> for Rc<[u8]>
impl From<Rc<ByteStr>> for Rc<[u8]>
impl From<Rc<[u8]>> for Rc<ByteStr>
impl From<FromUtf8Error> for PyErr
impl From<FromUtf16Error> for PyErr
impl From<String> for TimecatError
impl From<String> for Color
impl From<String> for Value
impl From<String> for Box<str>
impl From<String> for Rc<str>
impl From<String> for Vec<u8>
impl From<String> for OsString
impl From<String> for Bytes
impl From<String> for ColoredString
impl From<String> for JsString
impl From<String> for JsValue
impl From<String> for Arc<str>
impl From<String> for PathBuf
impl From<Vec<u8>> for Bytes
impl From<Vec<NonZero<u8>>> for CString
impl From<Vec<NonZero<u8>>> for NullString
impl From<Vec<NonZero<u16>>> for NullWideString
impl From<LayoutError> for TryReserveErrorKind
impl From<TryFromSliceError> for TimecatError
impl From<TryFromSliceError> for PyErr
impl From<DecodeUtf16Error> for PyErr
impl From<__m128> for Simd<f32, 4>
impl From<__m128d> for Simd<f64, 2>
impl From<__m128i> for Simd<i8, 16>
impl From<__m128i> for Simd<i16, 8>
impl From<__m128i> for Simd<i32, 4>
impl From<__m128i> for Simd<i64, 2>
impl From<__m128i> for Simd<isize, 2>
impl From<__m128i> for Simd<u8, 16>
impl From<__m128i> for Simd<u16, 8>
impl From<__m128i> for Simd<u32, 4>
impl From<__m128i> for Simd<u64, 2>
impl From<__m128i> for Simd<usize, 2>
impl From<__m256> for Simd<f32, 8>
impl From<__m256d> for Simd<f64, 4>
impl From<__m256i> for Simd<i8, 32>
impl From<__m256i> for Simd<i16, 16>
impl From<__m256i> for Simd<i32, 8>
impl From<__m256i> for Simd<i64, 4>
impl From<__m256i> for Simd<isize, 4>
impl From<__m256i> for Simd<u8, 32>
impl From<__m256i> for Simd<u16, 16>
impl From<__m256i> for Simd<u32, 8>
impl From<__m256i> for Simd<u64, 4>
impl From<__m256i> for Simd<usize, 4>
impl From<__m512> for Simd<f32, 16>
impl From<__m512d> for Simd<f64, 8>
impl From<__m512i> for Simd<i8, 64>
impl From<__m512i> for Simd<i16, 32>
impl From<__m512i> for Simd<i32, 16>
impl From<__m512i> for Simd<i64, 8>
impl From<__m512i> for Simd<isize, 8>
impl From<__m512i> for Simd<u8, 64>
impl From<__m512i> for Simd<u16, 32>
impl From<__m512i> for Simd<u32, 16>
impl From<__m512i> for Simd<u64, 8>
impl From<__m512i> for Simd<usize, 8>
impl From<Simd<f32, 4>> for __m128
impl From<Simd<f32, 8>> for __m256
impl From<Simd<f32, 16>> for __m512
impl From<Simd<f64, 2>> for __m128d
impl From<Simd<f64, 4>> for __m256d
impl From<Simd<f64, 8>> for __m512d
impl From<Simd<i8, 16>> for __m128i
impl From<Simd<i8, 32>> for __m256i
impl From<Simd<i8, 64>> for __m512i
impl From<Simd<i16, 8>> for __m128i
impl From<Simd<i16, 16>> for __m256i
impl From<Simd<i16, 32>> for __m512i
impl From<Simd<i32, 4>> for __m128i
impl From<Simd<i32, 8>> for __m256i
impl From<Simd<i32, 16>> for __m512i
impl From<Simd<i64, 2>> for __m128i
impl From<Simd<i64, 4>> for __m256i
impl From<Simd<i64, 8>> for __m512i
impl From<Simd<isize, 2>> for __m128i
impl From<Simd<isize, 4>> for __m256i
impl From<Simd<isize, 8>> for __m512i
impl From<Simd<u8, 16>> for __m128i
impl From<Simd<u8, 32>> for __m256i
impl From<Simd<u8, 64>> for __m512i
impl From<Simd<u16, 8>> for __m128i
impl From<Simd<u16, 16>> for __m256i
impl From<Simd<u16, 32>> for __m512i
impl From<Simd<u32, 4>> for __m128i
impl From<Simd<u32, 8>> for __m256i
impl From<Simd<u32, 16>> for __m512i
impl From<Simd<u64, 2>> for __m128i
impl From<Simd<u64, 4>> for __m256i
impl From<Simd<u64, 8>> for __m512i
impl From<Simd<usize, 2>> for __m128i
impl From<Simd<usize, 4>> for __m256i
impl From<Simd<usize, 8>> for __m512i
impl From<Ipv4Addr> for IpAddr
impl From<Ipv4Addr> for u32
impl From<Ipv6Addr> for IpAddr
impl From<Ipv6Addr> for u128
impl From<AddrParseError> for PyErr
impl From<SocketAddrV4> for SocketAddr
impl From<SocketAddrV6> for SocketAddr
impl From<ParseFloatError> for PyErr
impl From<TryFromIntError> for PyErr
impl From<NonZero<i8>> for NonZero<i16>
impl From<NonZero<i8>> for NonZero<i32>
impl From<NonZero<i8>> for NonZero<i64>
impl From<NonZero<i8>> for NonZero<i128>
impl From<NonZero<i8>> for NonZero<isize>
impl From<NonZero<i16>> for NonZero<i32>
impl From<NonZero<i16>> for NonZero<i64>
impl From<NonZero<i16>> for NonZero<i128>
impl From<NonZero<i16>> for NonZero<isize>
impl From<NonZero<i32>> for NonZero<i64>
impl From<NonZero<i32>> for NonZero<i128>
impl From<NonZero<i64>> for NonZero<i128>
impl From<NonZero<u8>> for NonZero<i16>
impl From<NonZero<u8>> for NonZero<i32>
impl From<NonZero<u8>> for NonZero<i64>
impl From<NonZero<u8>> for NonZero<i128>
impl From<NonZero<u8>> for NonZero<isize>
impl From<NonZero<u8>> for NonZero<u16>
impl From<NonZero<u8>> for NonZero<u32>
impl From<NonZero<u8>> for NonZero<u64>
impl From<NonZero<u8>> for NonZero<u128>
impl From<NonZero<u8>> for NonZero<usize>
impl From<NonZero<u16>> for NonZero<i32>
impl From<NonZero<u16>> for NonZero<i64>
impl From<NonZero<u16>> for NonZero<i128>
impl From<NonZero<u16>> for NonZero<u32>
impl From<NonZero<u16>> for NonZero<u64>
impl From<NonZero<u16>> for NonZero<u128>
impl From<NonZero<u16>> for NonZero<usize>
impl From<NonZero<u32>> for NonZero<i64>
impl From<NonZero<u32>> for NonZero<i128>
impl From<NonZero<u32>> for NonZero<u64>
impl From<NonZero<u32>> for NonZero<u128>
impl From<NonZero<u64>> for NonZero<i128>
impl From<NonZero<u64>> for NonZero<u128>
impl From<Alignment> for usize
impl From<Alignment> for NonZero<usize>
impl From<Utf8Error> for PyErr
impl From<OsString> for Box<OsStr>
impl From<OsString> for Rc<OsStr>
impl From<OsString> for Arc<OsStr>
impl From<OsString> for PathBuf
impl From<Error> for TimecatError
impl From<Error> for binread::error::Error
impl From<Error> for Box<ErrorKind>
impl From<Error> for PyErr
Create PyErr
from io::Error
(OSError
except if the io::Error
is wrapping a Python exception,
in this case the exception is returned)
impl From<PipeReader> for OwnedFd
impl From<PipeReader> for Stdio
impl From<PipeWriter> for OwnedFd
impl From<PipeWriter> for Stdio
impl From<Stderr> for Stdio
impl From<Stdout> for Stdio
impl From<TcpListener> for OwnedFd
impl From<TcpStream> for OwnedFd
impl From<UdpSocket> for OwnedFd
impl From<OwnedFd> for timecat::fs::File
impl From<OwnedFd> for PipeReader
impl From<OwnedFd> for PipeWriter
impl From<OwnedFd> for TcpListener
impl From<OwnedFd> for TcpStream
impl From<OwnedFd> for UdpSocket
impl From<OwnedFd> for PidFd
impl From<OwnedFd> for UnixDatagram
impl From<OwnedFd> for UnixListener
impl From<OwnedFd> for UnixStream
impl From<OwnedFd> for ChildStderr
Creates a ChildStderr
from the provided OwnedFd
.
The provided file descriptor must point to a pipe
with the CLOEXEC
flag set.
impl From<OwnedFd> for ChildStdin
Creates a ChildStdin
from the provided OwnedFd
.
The provided file descriptor must point to a pipe
with the CLOEXEC
flag set.
impl From<OwnedFd> for ChildStdout
Creates a ChildStdout
from the provided OwnedFd
.
The provided file descriptor must point to a pipe
with the CLOEXEC
flag set.
impl From<OwnedFd> for Stdio
impl From<PidFd> for OwnedFd
impl From<UnixDatagram> for OwnedFd
impl From<UnixListener> for OwnedFd
impl From<UnixStream> for OwnedFd
impl From<ChildStderr> for OwnedFd
impl From<ChildStderr> for Stdio
impl From<ChildStdin> for OwnedFd
impl From<ChildStdin> for Stdio
impl From<ChildStdout> for OwnedFd
impl From<ChildStdout> for Stdio
impl From<ExitStatusError> for ExitStatus
impl From<RecvError> for RecvTimeoutError
impl From<RecvError> for TryRecvError
impl From<NullString> for Vec<u8>
impl From<NullWideString> for Vec<u16>
impl From<Bytes> for Vec<u8>
impl From<Bytes> for BytesMut
impl From<BytesMut> for Vec<u8>
impl From<BytesMut> for Bytes
impl From<TryGetError> for std::io::error::Error
impl From<ColoredString> for Box<dyn Error>
impl From<Blob> for ObjectUrl
impl From<Blob> for JsValue
impl From<Blob> for web_sys::features::gen_Blob::Blob
impl From<File> for gloo_file::blob::Blob
impl From<File> for ObjectUrl
impl From<BrowserHistory> for AnyHistory
impl From<HashHistory> for AnyHistory
impl From<MemoryHistory> for AnyHistory
impl From<Request> for web_sys::features::gen_Request::Request
impl From<Response> for web_sys::features::gen_Response::Response
impl From<MaxSizeReached> for http::error::Error
impl From<HeaderName> for HeaderValue
impl From<InvalidHeaderName> for http::error::Error
impl From<InvalidHeaderValue> for http::error::Error
impl From<InvalidMethod> for http::error::Error
impl From<InvalidStatusCode> for http::error::Error
impl From<StatusCode> for u16
impl From<Authority> for Uri
Convert an Authority
into a Uri
.
impl From<PathAndQuery> for Uri
Convert a PathAndQuery
into a Uri
.
impl From<InvalidUri> for http::error::Error
impl From<InvalidUriParts> for http::error::Error
impl From<Uri> for Parts
Convert a Uri
into Parts
impl From<Collator> for Object
impl From<Collator> for JsValue
impl From<DateTimeFormat> for Object
impl From<DateTimeFormat> for JsValue
impl From<NumberFormat> for Object
impl From<NumberFormat> for JsValue
impl From<PluralRules> for Object
impl From<PluralRules> for JsValue
impl From<RelativeTimeFormat> for Object
impl From<RelativeTimeFormat> for JsValue
impl From<CompileError> for js_sys::Error
impl From<CompileError> for JsValue
impl From<Exception> for Object
impl From<Exception> for JsValue
impl From<Global> for Object
impl From<Global> for JsValue
impl From<Instance> for Object
impl From<Instance> for JsValue
impl From<LinkError> for js_sys::Error
impl From<LinkError> for JsValue
impl From<Memory> for Object
impl From<Memory> for JsValue
impl From<Module> for Object
impl From<Module> for JsValue
impl From<RuntimeError> for js_sys::Error
impl From<RuntimeError> for JsValue
impl From<Table> for Object
impl From<Table> for JsValue
impl From<Tag> for Object
impl From<Tag> for JsValue
impl From<Array> for Object
impl From<Array> for JsValue
impl From<ArrayBuffer> for Object
impl From<ArrayBuffer> for JsValue
impl From<AsyncIterator> for JsValue
impl From<BigInt64Array> for Object
impl From<BigInt64Array> for JsValue
impl From<BigInt> for Object
impl From<BigInt> for JsValue
impl From<BigUint64Array> for Object
impl From<BigUint64Array> for JsValue
impl From<Boolean> for bool
impl From<Boolean> for Object
impl From<Boolean> for JsValue
impl From<DataView> for Object
impl From<DataView> for JsValue
impl From<Date> for Object
impl From<Date> for JsValue
impl From<Error> for gloo_utils::errors::JsError
impl From<Error> for Object
impl From<Error> for JsValue
impl From<EvalError> for js_sys::Error
impl From<EvalError> for Object
impl From<EvalError> for JsValue
impl From<Float32Array> for Object
impl From<Float32Array> for JsValue
impl From<Float64Array> for Object
impl From<Float64Array> for JsValue
impl From<Function> for Object
impl From<Function> for JsValue
impl From<Generator> for Object
impl From<Generator> for JsValue
impl From<Int8Array> for Object
impl From<Int8Array> for JsValue
impl From<Int16Array> for Object
impl From<Int16Array> for JsValue
impl From<Int32Array> for Object
impl From<Int32Array> for JsValue
impl From<Iterator> for UncheckedIter
impl From<Iterator> for JsValue
impl From<IteratorNext> for Object
impl From<IteratorNext> for JsValue
impl From<JsString> for String
impl From<JsString> for Object
impl From<JsString> for JsValue
impl From<Map> for Object
impl From<Map> for JsValue
impl From<Number> for f64
impl From<Number> for Object
impl From<Number> for JsValue
impl From<Object> for JsValue
impl From<Promise> for Object
impl From<Promise> for JsFuture
impl From<Promise> for JsValue
impl From<Proxy> for JsValue
impl From<RangeError> for js_sys::Error
impl From<RangeError> for Object
impl From<RangeError> for JsValue
impl From<ReferenceError> for js_sys::Error
impl From<ReferenceError> for Object
impl From<ReferenceError> for JsValue
impl From<RegExp> for Object
impl From<RegExp> for JsValue
impl From<Set> for Object
impl From<Set> for JsValue
impl From<Symbol> for JsValue
impl From<SyntaxError> for js_sys::Error
impl From<SyntaxError> for Object
impl From<SyntaxError> for JsValue
impl From<TypeError> for js_sys::Error
impl From<TypeError> for Object
impl From<TypeError> for JsValue
impl From<Uint8Array> for Object
impl From<Uint8Array> for JsValue
impl From<Uint8ClampedArray> for Object
impl From<Uint8ClampedArray> for JsValue
impl From<Uint16Array> for Object
impl From<Uint16Array> for JsValue
impl From<Uint32Array> for Object
impl From<Uint32Array> for JsValue
impl From<UriError> for js_sys::Error
impl From<UriError> for Object
impl From<UriError> for JsValue
impl From<WeakMap> for Object
impl From<WeakMap> for JsValue
impl From<WeakSet> for Object
impl From<WeakSet> for JsValue
impl From<DowncastError<'_, '_>> for PyErr
Convert DowncastError
to Python TypeError
.
impl From<DowncastIntoError<'_>> for PyErr
Convert DowncastIntoError
to Python TypeError
.
impl From<PyBorrowError> for PyErr
impl From<PyBorrowMutError> for PyErr
impl From<Error> for JsValue
impl From<Error> for HistoryError
impl From<Error> for gloo_net::error::Error
impl From<Error> for StorageError
impl From<Error> for std::io::error::Error
impl From<Map<String, Value>> for Value
impl From<Number> for Value
impl From<Clamped<Box<[f32]>>> for JsValue
impl From<Clamped<Box<[f64]>>> for JsValue
impl From<Clamped<Box<[i8]>>> for JsValue
impl From<Clamped<Box<[i16]>>> for JsValue
impl From<Clamped<Box<[i32]>>> for JsValue
impl From<Clamped<Box<[i64]>>> for JsValue
impl From<Clamped<Box<[u8]>>> for JsValue
impl From<Clamped<Box<[u16]>>> for JsValue
impl From<Clamped<Box<[u32]>>> for JsValue
impl From<Clamped<Box<[u64]>>> for JsValue
impl From<JsError> for JsValue
impl From<JsValue> for Collator
impl From<JsValue> for DateTimeFormat
impl From<JsValue> for NumberFormat
impl From<JsValue> for PluralRules
impl From<JsValue> for RelativeTimeFormat
impl From<JsValue> for CompileError
impl From<JsValue> for Exception
impl From<JsValue> for Global
impl From<JsValue> for Instance
impl From<JsValue> for LinkError
impl From<JsValue> for Memory
impl From<JsValue> for Module
impl From<JsValue> for RuntimeError
impl From<JsValue> for Table
impl From<JsValue> for Tag
impl From<JsValue> for Array
impl From<JsValue> for ArrayBuffer
impl From<JsValue> for AsyncIterator
impl From<JsValue> for BigInt64Array
impl From<JsValue> for BigInt
impl From<JsValue> for BigUint64Array
impl From<JsValue> for Boolean
impl From<JsValue> for DataView
impl From<JsValue> for Date
impl From<JsValue> for js_sys::Error
impl From<JsValue> for EvalError
impl From<JsValue> for Float32Array
impl From<JsValue> for Float64Array
impl From<JsValue> for Function
impl From<JsValue> for Generator
impl From<JsValue> for Int8Array
impl From<JsValue> for Int16Array
impl From<JsValue> for Int32Array
impl From<JsValue> for Iterator
impl From<JsValue> for IteratorNext
impl From<JsValue> for JsString
impl From<JsValue> for Map
impl From<JsValue> for js_sys::Number
impl From<JsValue> for Object
impl From<JsValue> for Promise
impl From<JsValue> for Proxy
impl From<JsValue> for RangeError
impl From<JsValue> for ReferenceError
impl From<JsValue> for RegExp
impl From<JsValue> for Set
impl From<JsValue> for Symbol
impl From<JsValue> for SyntaxError
impl From<JsValue> for TypeError
impl From<JsValue> for Uint8Array
impl From<JsValue> for Uint8ClampedArray
impl From<JsValue> for Uint16Array
impl From<JsValue> for Uint32Array
impl From<JsValue> for UriError
impl From<JsValue> for WeakMap
impl From<JsValue> for WeakSet
impl From<JsValue> for Deserializer
impl From<JsValue> for serde_wasm_bindgen::error::Error
This conversion is needed for ?
to just work when using wasm-bindgen
imports that return JavaScript exceptions as Result<T, JsValue>
.
impl From<JsValue> for AbortSignal
impl From<JsValue> for AddEventListenerOptions
impl From<JsValue> for web_sys::features::gen_Blob::Blob
impl From<JsValue> for BlobPropertyBag
impl From<JsValue> for CloseEvent
impl From<JsValue> for CloseEventInit
impl From<JsValue> for DedicatedWorkerGlobalScope
impl From<JsValue> for Document
impl From<JsValue> for DomException
impl From<JsValue> for Element
impl From<JsValue> for ErrorEvent
impl From<JsValue> for Event
impl From<JsValue> for EventSource
impl From<JsValue> for EventTarget
impl From<JsValue> for web_sys::features::gen_File::File
impl From<JsValue> for web_sys::features::gen_FileList::FileList
impl From<JsValue> for FilePropertyBag
impl From<JsValue> for FileReader
impl From<JsValue> for FormData
impl From<JsValue> for Headers
impl From<JsValue> for History
impl From<JsValue> for HtmlElement
impl From<JsValue> for HtmlHeadElement
impl From<JsValue> for HtmlInputElement
impl From<JsValue> for Location
impl From<JsValue> for MessageEvent
impl From<JsValue> for Node
impl From<JsValue> for ObserverCallback
impl From<JsValue> for ProgressEvent
impl From<JsValue> for ReadableStream
impl From<JsValue> for web_sys::features::gen_Request::Request
impl From<JsValue> for RequestInit
impl From<JsValue> for web_sys::features::gen_Response::Response
impl From<JsValue> for ResponseInit
impl From<JsValue> for Storage
impl From<JsValue> for Url
impl From<JsValue> for UrlSearchParams
impl From<JsValue> for WebSocket
impl From<JsValue> for Window
impl From<JsValue> for Worker
impl From<JsValue> for WorkerGlobalScope
impl From<JsValue> for WorkerOptions
impl From<AbortSignal> for Object
impl From<AbortSignal> for JsValue
impl From<AbortSignal> for EventTarget
impl From<AddEventListenerOptions> for Object
impl From<AddEventListenerOptions> for JsValue
impl From<Blob> for gloo_file::blob::Blob
impl From<Blob> for ObjectUrl
impl From<Blob> for Object
impl From<Blob> for JsValue
impl From<BlobPropertyBag> for Object
impl From<BlobPropertyBag> for JsValue
impl From<CloseEvent> for Object
impl From<CloseEvent> for JsValue
impl From<CloseEvent> for Event
impl From<CloseEventInit> for Object
impl From<CloseEventInit> for JsValue
impl From<DedicatedWorkerGlobalScope> for Object
impl From<DedicatedWorkerGlobalScope> for JsValue
impl From<DedicatedWorkerGlobalScope> for EventTarget
impl From<DedicatedWorkerGlobalScope> for WorkerGlobalScope
impl From<Document> for Object
impl From<Document> for JsValue
impl From<Document> for EventTarget
impl From<Document> for Node
impl From<DomException> for Object
impl From<DomException> for JsValue
impl From<Element> for Object
impl From<Element> for JsValue
impl From<Element> for EventTarget
impl From<Element> for Node
impl From<ErrorEvent> for Object
impl From<ErrorEvent> for JsValue
impl From<ErrorEvent> for Event
impl From<Event> for Object
impl From<Event> for JsValue
impl From<EventSource> for Object
impl From<EventSource> for JsValue
impl From<EventSource> for EventTarget
impl From<EventTarget> for Object
impl From<EventTarget> for JsValue
impl From<File> for gloo_file::blob::Blob
impl From<File> for gloo_file::blob::File
impl From<File> for Object
impl From<File> for JsValue
impl From<File> for web_sys::features::gen_Blob::Blob
impl From<FileList> for gloo_file::file_list::FileList
impl From<FileList> for Object
impl From<FileList> for JsValue
impl From<FilePropertyBag> for Object
impl From<FilePropertyBag> for JsValue
impl From<FileReader> for Object
impl From<FileReader> for JsValue
impl From<FileReader> for EventTarget
impl From<FormData> for Object
impl From<FormData> for JsValue
impl From<Headers> for Object
impl From<Headers> for JsValue
impl From<History> for Object
impl From<History> for JsValue
impl From<HtmlElement> for Object
impl From<HtmlElement> for JsValue
impl From<HtmlElement> for Element
impl From<HtmlElement> for EventTarget
impl From<HtmlElement> for Node
impl From<HtmlHeadElement> for Object
impl From<HtmlHeadElement> for JsValue
impl From<HtmlHeadElement> for Element
impl From<HtmlHeadElement> for EventTarget
impl From<HtmlHeadElement> for HtmlElement
impl From<HtmlHeadElement> for Node
impl From<HtmlInputElement> for Object
impl From<HtmlInputElement> for JsValue
impl From<HtmlInputElement> for Element
impl From<HtmlInputElement> for EventTarget
impl From<HtmlInputElement> for HtmlElement
impl From<HtmlInputElement> for Node
impl From<Location> for Object
impl From<Location> for JsValue
impl From<MessageEvent> for Object
impl From<MessageEvent> for JsValue
impl From<MessageEvent> for Event
impl From<Node> for Object
impl From<Node> for JsValue
impl From<Node> for EventTarget
impl From<ObserverCallback> for Object
impl From<ObserverCallback> for JsValue
impl From<ProgressEvent> for Object
impl From<ProgressEvent> for JsValue
impl From<ProgressEvent> for Event
impl From<ReadableStream> for Object
impl From<ReadableStream> for JsValue
impl From<Request> for gloo_net::http::request::Request
impl From<Request> for Object
impl From<Request> for JsValue
impl From<RequestInit> for Object
impl From<RequestInit> for JsValue
impl From<Response> for gloo_net::http::response::Response
impl From<Response> for Object
impl From<Response> for JsValue
impl From<ResponseInit> for Object
impl From<ResponseInit> for JsValue
impl From<Storage> for Object
impl From<Storage> for JsValue
impl From<Url> for Object
impl From<Url> for JsValue
impl From<UrlSearchParams> for Object
impl From<UrlSearchParams> for JsValue
impl From<WebSocket> for Object
impl From<WebSocket> for JsValue
impl From<WebSocket> for EventTarget
impl From<Window> for Object
impl From<Window> for JsValue
impl From<Window> for EventTarget
impl From<Worker> for Object
impl From<Worker> for JsValue
impl From<Worker> for EventTarget
impl From<WorkerGlobalScope> for Object
impl From<WorkerGlobalScope> for JsValue
impl From<WorkerGlobalScope> for EventTarget
impl From<WorkerOptions> for Object
impl From<WorkerOptions> for JsValue
impl From<Arc<str>> for Arc<[u8]>
impl From<Arc<ByteStr>> for Arc<[u8]>
impl From<Arc<[u8]>> for Arc<ByteStr>
impl From<Bound<'_, PyByteArray>> for PyBackedBytes
impl From<Bound<'_, PyBytes>> for PyBackedBytes
impl From<ParseBoolError> for TimecatError
impl From<ParseBoolError> for PyErr
impl From<ParseIntError> for TimecatError
impl From<ParseIntError> for PyErr
impl From<PathBuf> for Box<Path>
impl From<PathBuf> for Rc<Path>
impl From<PathBuf> for OsString
impl From<PathBuf> for Arc<Path>
impl From<PyErr> for std::io::error::Error
Convert PyErr
to io::Error
impl From<BitBoard> for u64
impl From<Move> for ValidOrNullMove
impl From<ByteStr> for Bytes
impl From<Custom> for Bytes
impl From<ErrorKind> for InvalidUri
impl From<ErrorKind> for InvalidUriParts
impl From<Global> for JsValue
impl From<Global> for JsValue
impl From<MaybeIterator> for JsValue
impl From<ObjectExt> for JsValue
impl From<ParserNumber> for serde_json::number::Number
impl From<PyASCIIObjectState> for u32
impl From<[u8; 4]> for IpAddr
impl From<[u8; 4]> for Ipv4Addr
impl From<[u8; 16]> for IpAddr
impl From<[u8; 16]> for Ipv6Addr
impl From<[u16; 8]> for IpAddr
impl From<[u16; 8]> for Ipv6Addr
impl<'a> From<&'a str> for Cow<'a, str>
impl<'a> From<&'a str> for BytesMut
impl<'a> From<&'a str> for ColoredString
impl<'a> From<&'a str> for JsString
impl<'a> From<&'a str> for JsValue
impl<'a> From<&'a ByteString> for Cow<'a, ByteStr>
impl<'a> From<&'a CString> for Cow<'a, CStr>
impl<'a> From<&'a String> for Cow<'a, str>
impl<'a> From<&'a String> for JsValue
impl<'a> From<&'a ByteStr> for Cow<'a, ByteStr>
impl<'a> From<&'a ByteStr> for ByteString
impl<'a> From<&'a CStr> for Cow<'a, CStr>
impl<'a> From<&'a OsStr> for Cow<'a, OsStr>
impl<'a> From<&'a OsString> for Cow<'a, OsStr>
impl<'a> From<&'a HeaderName> for HeaderName
impl<'a> From<&'a HeaderValue> for HeaderValue
impl<'a> From<&'a Method> for Method
impl<'a> From<&'a StatusCode> for StatusCode
impl<'a> From<&'a JsString> for String
impl<'a> From<&'a Path> for Cow<'a, Path>
impl<'a> From<&'a PathBuf> for Cow<'a, Path>
impl<'a> From<&'a [f32]> for Float32Array
impl<'a> From<&'a [f64]> for Float64Array
impl<'a> From<&'a [i8]> for Int8Array
impl<'a> From<&'a [i16]> for Int16Array
impl<'a> From<&'a [i32]> for Int32Array
impl<'a> From<&'a [i64]> for BigInt64Array
impl<'a> From<&'a [u8]> for BytesMut
impl<'a> From<&'a [u8]> for Uint8Array
impl<'a> From<&'a [u8]> for Uint8ClampedArray
impl<'a> From<&'a [u16]> for Uint16Array
impl<'a> From<&'a [u32]> for Uint32Array
impl<'a> From<&'a [u64]> for BigUint64Array
impl<'a> From<&'a mut [u8]> for &'a mut UninitSlice
impl<'a> From<&'a mut [MaybeUninit<u8>]> for &'a mut UninitSlice
impl<'a> From<&str> for Box<dyn Error + 'a>
impl<'a> From<&str> for Box<dyn Error + Send + Sync + 'a>
impl<'a> From<Cow<'a, str>> for Value
impl<'a> From<Cow<'a, str>> for String
impl<'a> From<Cow<'a, CStr>> for CString
impl<'a> From<Cow<'a, OsStr>> for OsString
impl<'a> From<Cow<'a, Path>> for PathBuf
impl<'a> From<ByteString> for Cow<'a, ByteStr>
impl<'a> From<CString> for Cow<'a, CStr>
impl<'a> From<String> for Cow<'a, str>
impl<'a> From<String> for Box<dyn Error + 'a>
impl<'a> From<String> for Box<dyn Error + Send + Sync + 'a>
impl<'a> From<OsString> for Cow<'a, OsStr>
impl<'a> From<PercentDecode<'a>> for Cow<'a, [u8]>
impl<'a> From<PercentEncode<'a>> for Cow<'a, str>
impl<'a> From<PathBuf> for Cow<'a, Path>
impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + 'a>
impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a>
impl<'a, 'py, T> From<&'a Bound<'py, T>> for Borrowed<'a, 'py, T>
impl<'a, 'py, T> From<BoundRef<'a, 'py, T>> for &'a Bound<'py, T>
impl<'a, 'py, T> From<BoundRef<'a, 'py, T>> for Bound<'py, T>
impl<'a, B> From<Cow<'a, B>> for Rc<B>
impl<'a, B> From<Cow<'a, B>> for Arc<B>
impl<'a, E> From<E> for Box<dyn Error + 'a>where
E: Error + 'a,
impl<'a, E> From<E> for Box<dyn Error + Send + Sync + 'a>
impl<'a, T> From<&'a Option<T>> for Option<&'a T>
impl<'a, T> From<&'a [T]> for Cow<'a, [T]>where
T: Clone,
impl<'a, T> From<&'a Vec<T>> for Cow<'a, [T]>where
T: Clone,
impl<'a, T> From<&'a mut Option<T>> for Option<&'a mut T>
impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
impl<'a, T> From<&'a T> for JsValuewhere
T: JsCast,
impl<'a, T> From<Vec<T>> for Cow<'a, [T]>where
T: Clone,
impl<'a, T> From<PyRef<'a, T>> for Py<T>where
T: PyClass,
impl<'a, T> From<PyRefMut<'a, T>> for Py<T>where
T: PyClass<Frozen = False>,
impl<'a, T, const N: usize> From<&'a [T; N]> for Cow<'a, [T]>where
T: Clone,
impl<'data> From<&'data mut [u8]> for BorrowedBuf<'data>
Creates a new BorrowedBuf
from a fully initialized slice.
impl<'data> From<&'data mut [MaybeUninit<u8>]> for BorrowedBuf<'data>
Creates a new BorrowedBuf
from an uninitialized buffer.
Use set_init
if part of the buffer is known to be already initialized.
impl<'data> From<BorrowedCursor<'data>> for BorrowedBuf<'data>
Creates a new BorrowedBuf
from a cursor.
Use BorrowedCursor::with_unfilled_buf
instead for a safer alternative.
impl<'key> From<Key<'key>> for Cow<'static, str>
impl<'py, T> From<Bound<'py, T>> for PyClassInitializer<T>where
T: PyClass,
impl<'py, T> From<Bound<'py, T>> for PyErrwhere
T: ToPyErr,
impl<A> From<(A,)> for Zip<(<A as IntoIterator>::IntoIter,)>where
A: IntoIterator,
impl<A> From<Box<str, A>> for Box<[u8], A>where
A: Allocator,
impl<A, B> From<Either<A, B>> for EitherOrBoth<A, B>
impl<A, B> From<EitherOrBoth<A, B>> for Option<Either<A, B>>
impl<A, B> From<(A, B)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter)>where
A: IntoIterator,
B: IntoIterator,
impl<A, B, C> From<(A, B, C)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter)>
impl<A, B, C, D> From<(A, B, C, D)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter, <D as IntoIterator>::IntoIter)>
impl<A, B, C, D, E> From<(A, B, C, D, E)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter, <D as IntoIterator>::IntoIter, <E as IntoIterator>::IntoIter)>
impl<A, B, C, D, E, F> From<(A, B, C, D, E, F)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter, <D as IntoIterator>::IntoIter, <E as IntoIterator>::IntoIter, <F as IntoIterator>::IntoIter)>where
A: IntoIterator,
B: IntoIterator,
C: IntoIterator,
D: IntoIterator,
E: IntoIterator,
F: IntoIterator,
impl<A, B, C, D, E, F, G> From<(A, B, C, D, E, F, G)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter, <D as IntoIterator>::IntoIter, <E as IntoIterator>::IntoIter, <F as IntoIterator>::IntoIter, <G as IntoIterator>::IntoIter)>where
A: IntoIterator,
B: IntoIterator,
C: IntoIterator,
D: IntoIterator,
E: IntoIterator,
F: IntoIterator,
G: IntoIterator,
impl<A, B, C, D, E, F, G, H> From<(A, B, C, D, E, F, G, H)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter, <D as IntoIterator>::IntoIter, <E as IntoIterator>::IntoIter, <F as IntoIterator>::IntoIter, <G as IntoIterator>::IntoIter, <H as IntoIterator>::IntoIter)>where
A: IntoIterator,
B: IntoIterator,
C: IntoIterator,
D: IntoIterator,
E: IntoIterator,
F: IntoIterator,
G: IntoIterator,
H: IntoIterator,
impl<A, B, C, D, E, F, G, H, I> From<(A, B, C, D, E, F, G, H, I)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter, <D as IntoIterator>::IntoIter, <E as IntoIterator>::IntoIter, <F as IntoIterator>::IntoIter, <G as IntoIterator>::IntoIter, <H as IntoIterator>::IntoIter, <I as IntoIterator>::IntoIter)>where
A: IntoIterator,
B: IntoIterator,
C: IntoIterator,
D: IntoIterator,
E: IntoIterator,
F: IntoIterator,
G: IntoIterator,
H: IntoIterator,
I: IntoIterator,
impl<A, B, C, D, E, F, G, H, I, J> From<(A, B, C, D, E, F, G, H, I, J)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter, <D as IntoIterator>::IntoIter, <E as IntoIterator>::IntoIter, <F as IntoIterator>::IntoIter, <G as IntoIterator>::IntoIter, <H as IntoIterator>::IntoIter, <I as IntoIterator>::IntoIter, <J as IntoIterator>::IntoIter)>where
A: IntoIterator,
B: IntoIterator,
C: IntoIterator,
D: IntoIterator,
E: IntoIterator,
F: IntoIterator,
G: IntoIterator,
H: IntoIterator,
I: IntoIterator,
J: IntoIterator,
impl<A, B, C, D, E, F, G, H, I, J, K> From<(A, B, C, D, E, F, G, H, I, J, K)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter, <D as IntoIterator>::IntoIter, <E as IntoIterator>::IntoIter, <F as IntoIterator>::IntoIter, <G as IntoIterator>::IntoIter, <H as IntoIterator>::IntoIter, <I as IntoIterator>::IntoIter, <J as IntoIterator>::IntoIter, <K as IntoIterator>::IntoIter)>where
A: IntoIterator,
B: IntoIterator,
C: IntoIterator,
D: IntoIterator,
E: IntoIterator,
F: IntoIterator,
G: IntoIterator,
H: IntoIterator,
I: IntoIterator,
J: IntoIterator,
K: IntoIterator,
impl<A, B, C, D, E, F, G, H, I, J, K, L> From<(A, B, C, D, E, F, G, H, I, J, K, L)> for Zip<(<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter, <C as IntoIterator>::IntoIter, <D as IntoIterator>::IntoIter, <E as IntoIterator>::IntoIter, <F as IntoIterator>::IntoIter, <G as IntoIterator>::IntoIter, <H as IntoIterator>::IntoIter, <I as IntoIterator>::IntoIter, <J as IntoIterator>::IntoIter, <K as IntoIterator>::IntoIter, <L as IntoIterator>::IntoIter)>where
A: IntoIterator,
B: IntoIterator,
C: IntoIterator,
D: IntoIterator,
E: IntoIterator,
F: IntoIterator,
G: IntoIterator,
H: IntoIterator,
I: IntoIterator,
J: IntoIterator,
K: IntoIterator,
L: IntoIterator,
impl<E> From<E> for Report<E>where
E: Error,
impl<E> From<E> for wasm_bindgen::JsErrorwhere
E: Error,
impl<I> From<(I, u16)> for SocketAddr
impl<K, V, const N: usize> From<[(K, V); N]> for BTreeMap<K, V>where
K: Ord,
impl<K, V, const N: usize> From<[(K, V); N]> for HashMap<K, V>
impl<L, R> From<Either<L, R>> for core::result::Result<R, L>
Convert from Either
to Result
with Right => Ok
and Left => Err
.
impl<L, R> From<Result<R, L>> for Either<L, R>
Convert from Result
to Either
with Ok => Right
and Err => Left
.
impl<P: PositionEvaluation> From<&Searcher<P>> for SearchInfo
impl<S, B> From<(S, B)> for PyClassInitializer<S>where
B: PyClass + PyClassBaseType<Initializer = PyClassInitializer<B>>,
<B as PyClassImpl>::BaseType: PyClassBaseType<Initializer = PyNativeTypeInitializer<<B as PyClassImpl>::BaseType>>,
S: PyClass<BaseType = B>,
impl<T> From<&[T]> for Value
impl<T> From<&[T]> for Box<[T]>where
T: Clone,
impl<T> From<&[T]> for Rc<[T]>where
T: Clone,
impl<T> From<&[T]> for Vec<T>where
T: Clone,
impl<T> From<&[T]> for Arc<[T]>where
T: Clone,
impl<T> From<&mut [T]> for Box<[T]>where
T: Clone,
impl<T> From<&mut [T]> for Rc<[T]>where
T: Clone,
impl<T> From<&mut [T]> for Vec<T>where
T: Clone,
impl<T> From<&mut [T]> for Arc<[T]>where
T: Clone,
impl<T> From<Cow<'_, [T]>> for Box<[T]>where
T: Clone,
impl<T> From<Option<T>> for Value
impl<T> From<Option<T>> for JsValue
impl<T> From<[T; N]> for (T₁, T₂, …, Tₙ)
This trait is implemented for tuples up to twelve items long.
impl<T> From<!> for T
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<T> From<*const T> for JsValue
impl<T> From<*mut T> for AtomicPtr<T>
impl<T> From<*mut T> for JsValue
impl<T> From<&T> for NonNull<T>where
T: ?Sized,
impl<T> From<&T> for OsString
impl<T> From<&T> for PathBuf
impl<T> From<&mut T> for NonNull<T>where
T: ?Sized,
impl<T> From<(T₁, T₂, …, Tₙ)> for [T; N]
This trait is implemented for tuples up to twelve items long.
impl<T> From<Box<[T]>> for JsValuewhere
T: VectorIntoJsValue,
impl<T> From<Vec<T>> for Value
impl<T> From<Vec<T>> for JsValue
impl<T> From<NonZero<T>> for Twhere
T: ZeroablePrimitive,
impl<T> From<RangeFrom<T>> for core::range::RangeFrom<T>
impl<T> From<RangeInclusive<T>> for core::range::RangeInclusive<T>
impl<T> From<NonNull<T>> for JsValue
impl<T> From<Range<T>> for timecat::Range<T>
impl<T> From<RangeFrom<T>> for core::ops::range::RangeFrom<T>
impl<T> From<RangeInclusive<T>> for core::ops::range::RangeInclusive<T>
impl<T> From<SendError<T>> for SendTimeoutError<T>
impl<T> From<SendError<T>> for TrySendError<T>
impl<T> From<PoisonError<T>> for TryLockError<T>
impl<T> From<Port<T>> for u16
impl<T> From<Clamped<Vec<T>>> for JsValue
impl<T> From<Borrowed<'_, '_, T>> for Py<T>
impl<T> From<Bound<'_, T>> for Py<PyAny>where
T: DerefToPyAny,
impl<T> From<Bound<'_, T>> for Py<T>
impl<T> From<Py<T>> for Py<PyAny>where
T: DerefToPyAny,
impl<T> From<Py<T>> for PyClassInitializer<T>where
T: PyClass,
impl<T> From<Range<T>> for core::range::Range<T>
impl<T> From<BoundRef<'_, '_, T>> for Py<T>
impl<T> From<T> for Option<T>
impl<T> From<T> for Poll<T>
impl<T> From<T> for Box<T>
impl<T> From<T> for Rc<T>
impl<T> From<T> for core::cell::once::OnceCell<T>
impl<T> From<T> for Cell<T>
impl<T> From<T> for RefCell<T>
impl<T> From<T> for SyncUnsafeCell<T>
impl<T> From<T> for UnsafeCell<T>
impl<T> From<T> for UnsafePinned<T>
impl<T> From<T> for Exclusive<T>
impl<T> From<T> for std::sync::nonpoison::mutex::Mutex<T>
impl<T> From<T> for OnceLock<T>
impl<T> From<T> for std::sync::poison::mutex::Mutex<T>
impl<T> From<T> for ReentrantLock<T>
impl<T> From<T> for once_cell::sync::OnceCell<T>
impl<T> From<T> for once_cell::unsync::OnceCell<T>
impl<T> From<T> for WasmRet<T>where
T: WasmAbi,
impl<T> From<T> for Arc<T>
impl<T> From<T> for PyClassInitializer<T>where
T: PyClass,
<T as PyClassImpl>::BaseType: PyClassBaseType<Initializer = PyNativeTypeInitializer<<T as PyClassImpl>::BaseType>>,
impl<T> From<T> for RwLock<T>
impl<T> From<T> for T
impl<T, A> From<Box<[T], A>> for Vec<T, A>where
A: Allocator,
impl<T, A> From<Box<T, A>> for Rc<T, A>
impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>
impl<T, A> From<Box<T, A>> for Arc<T, A>
impl<T, A> From<BinaryHeap<T, A>> for Vec<T, A>where
A: Allocator,
impl<T, A> From<VecDeque<T, A>> for Vec<T, A>where
A: Allocator,
impl<T, A> From<Vec<T, A>> for Box<[T], A>where
A: Allocator,
impl<T, A> From<Vec<T, A>> for BinaryHeap<T, A>
impl<T, A> From<Vec<T, A>> for VecDeque<T, A>where
A: Allocator,
impl<T, A> From<Vec<T, A>> for Rc<[T], A>where
A: Allocator,
impl<T, A> From<Vec<T, A>> for Arc<[T], A>
impl<T, const CAP: usize> From<[T; CAP]> for ArrayVec<T, CAP>
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);