1.0.0[−][src]Trait bevy_tilemap::From
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
impliesInto
<U> for T
From
is reflexive, which means thatFrom<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
#[lang = "from"]fn from(T) -> Self
Performs the conversion.
Implementations on Foreign Types
impl<'_> From<&'_ CStr> for Rc<CStr>
[src]
impl<I> From<(I, u16)> for SocketAddr where
I: Into<IpAddr>,
[src]
I: Into<IpAddr>,
pub fn from(pieces: (I, u16)) -> SocketAddr
[src]
Converts a tuple struct (Into<IpAddr
>, u16
) into a SocketAddr
.
This conversion creates a SocketAddr::V4
for a IpAddr::V4
and creates a SocketAddr::V6
for a IpAddr::V6
.
u16
is treated as port of the newly created SocketAddr
.
impl From<[u8; 4]> for Ipv4Addr
[src]
pub fn from(octets: [u8; 4]) -> Ipv4Addr
[src]
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);
impl From<[u8; 16]> for IpAddr
[src]
pub fn from(octets: [u8; 16]) -> IpAddr
[src]
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 );
impl<'_, T> From<&'_ T> for OsString where
T: AsRef<OsStr> + ?Sized,
[src]
T: AsRef<OsStr> + ?Sized,
impl From<String> for OsString
[src]
impl From<SocketAddrV6> for SocketAddr
[src]
pub fn from(sock6: SocketAddrV6) -> SocketAddr
[src]
Converts a SocketAddrV6
into a SocketAddr::V6
.
impl<'a> From<&'a Path> for Cow<'a, Path>
[src]
impl From<Vec<NonZeroU8>> for CString
[src]
impl<'a> From<Cow<'a, Path>> for PathBuf
[src]
impl<'_> From<&'_ Path> for Rc<Path>
[src]
pub fn from(s: &Path) -> Rc<Path>
[src]
Converts a Path
into an Rc
by copying the Path
data into a new Rc
buffer.
impl<'a> From<&'a OsStr> for Cow<'a, OsStr>
[src]
impl<'a> From<Cow<'a, OsStr>> for OsString
[src]
impl From<Box<OsStr>> for OsString
[src]
impl From<ChildStderr> for Stdio
[src]
pub fn from(child: ChildStderr) -> Stdio
[src]
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" );
impl<T> From<T> for RwLock<T>
[src]
pub fn from(t: T) -> RwLock<T>
[src]
Creates a new instance of an RwLock<T>
which is unlocked.
This is equivalent to RwLock::new
.
impl<'a> From<CString> for Cow<'a, CStr>
[src]
impl From<OsString> for Rc<OsStr>
[src]
impl From<NulError> for Error
[src]
impl From<Ipv4Addr> for u32
[src]
pub fn from(ip: Ipv4Addr) -> u32
[src]
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));
impl<'a> From<OsString> for Cow<'a, OsStr>
[src]
impl From<[u16; 8]> for IpAddr
[src]
pub fn from(segments: [u16; 8]) -> IpAddr
[src]
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 );
impl<'a> From<&'a OsString> for Cow<'a, OsStr>
[src]
impl From<[u8; 4]> for IpAddr
[src]
pub fn from(octets: [u8; 4]) -> IpAddr
[src]
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);
impl From<Box<CStr>> for CString
[src]
impl<'_, T> From<&'_ T> for PathBuf where
T: AsRef<OsStr> + ?Sized,
[src]
T: AsRef<OsStr> + ?Sized,
impl<'a> From<&'a PathBuf> for Cow<'a, Path>
[src]
impl<T> From<PoisonError<T>> for TryLockError<T>
[src]
pub fn from(err: PoisonError<T>) -> TryLockError<T>
[src]
impl From<Ipv6Addr> for u128
[src]
pub fn from(ip: Ipv6Addr) -> u128
[src]
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));
impl<'_> From<&'_ CStr> for CString
[src]
impl From<[u16; 8]> for Ipv6Addr
[src]
pub fn from(segments: [u16; 8]) -> Ipv6Addr
[src]
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 );
impl From<String> for PathBuf
[src]
pub fn from(s: String) -> PathBuf
[src]
Converts a String
into a PathBuf
This conversion does not allocate or copy memory.
impl From<PathBuf> for OsString
[src]
pub fn from(path_buf: PathBuf) -> OsString
[src]
Converts a PathBuf
into a OsString
This conversion does not allocate or copy memory.
impl<W> From<IntoInnerError<W>> for Error
[src]
pub fn from(iie: IntoInnerError<W>) -> Error
[src]
impl From<ErrorKind> for Error
[src]
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<T> From<SendError<T>> for TrySendError<T>
[src]
pub fn from(err: SendError<T>) -> TrySendError<T>
[src]
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.
impl<T> From<T> for SyncOnceCell<T>
[src]
pub fn from(value: T) -> SyncOnceCell<T>
[src]
impl From<CString> for Rc<CStr>
[src]
impl From<PathBuf> for Rc<Path>
[src]
pub fn from(s: PathBuf) -> Rc<Path>
[src]
Converts a PathBuf
into an Rc
by moving the PathBuf
data into a new Rc
buffer.
impl From<SocketAddrV4> for SocketAddr
[src]
pub fn from(sock4: SocketAddrV4) -> SocketAddr
[src]
Converts a SocketAddrV4
into a SocketAddr::V4
.
impl<'a> From<&'a CStr> for Cow<'a, CStr>
[src]
impl<'_> From<&'_ OsStr> for Rc<OsStr>
[src]
impl From<[u8; 16]> for Ipv6Addr
[src]
pub fn from(octets: [u8; 16]) -> Ipv6Addr
[src]
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 );
impl<'a> From<Cow<'a, CStr>> for CString
[src]
impl<'a> From<&'a CString> for Cow<'a, CStr>
[src]
impl From<RecvError> for TryRecvError
[src]
pub fn from(err: RecvError) -> TryRecvError
[src]
Converts a RecvError
into a TryRecvError
.
This conversion always returns TryRecvError::Disconnected
.
No data is allocated on the heap.
impl From<Ipv4Addr> for IpAddr
[src]
pub fn from(ipv4: Ipv4Addr) -> IpAddr
[src]
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) )
impl From<u32> for Ipv4Addr
[src]
pub fn from(ip: u32) -> Ipv4Addr
[src]
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);
impl From<ChildStdout> for Stdio
[src]
pub fn from(child: ChildStdout) -> Stdio
[src]
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");
impl From<Box<Path>> for PathBuf
[src]
pub fn from(boxed: Box<Path>) -> PathBuf
[src]
Converts a Box<Path>
into a PathBuf
This conversion does not allocate or copy memory.
impl From<u128> for Ipv6Addr
[src]
pub fn from(ip: u128) -> Ipv6Addr
[src]
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);
impl<'a> From<PathBuf> for Cow<'a, Path>
[src]
impl From<RecvError> for RecvTimeoutError
[src]
pub fn from(err: RecvError) -> RecvTimeoutError
[src]
Converts a RecvError
into a RecvTimeoutError
.
This conversion always returns RecvTimeoutError::Disconnected
.
No data is allocated on the heap.
impl From<ChildStdin> for Stdio
[src]
pub fn from(child: ChildStdin) -> Stdio
[src]
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
impl From<Ipv6Addr> for IpAddr
[src]
pub fn from(ipv6: Ipv6Addr) -> IpAddr
[src]
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) );
impl From<OsString> for PathBuf
[src]
pub fn from(s: OsString) -> PathBuf
[src]
Converts a OsString
into a PathBuf
This conversion does not allocate or copy memory.
impl From<File> for Stdio
[src]
pub fn from(file: File) -> Stdio
[src]
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");
impl From<NonZeroU8> for NonZeroU128
[src]
Converts NonZeroU8
to NonZeroU128
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroU128
[src]
impl From<NonZeroU64> for NonZeroI128
[src]
Converts NonZeroU64
to NonZeroI128
losslessly.
pub fn from(small: NonZeroU64) -> NonZeroI128
[src]
impl From<i32> for i128
[src]
Converts i32
to i128
losslessly.
impl From<NonZeroI16> for NonZeroI64
[src]
Converts NonZeroI16
to NonZeroI64
losslessly.
pub fn from(small: NonZeroI16) -> NonZeroI64
[src]
impl From<NonZeroI8> for NonZeroI16
[src]
Converts NonZeroI8
to NonZeroI16
losslessly.
pub fn from(small: NonZeroI8) -> NonZeroI16
[src]
impl From<f32> for f64
[src]
Converts f32
to f64
losslessly.
impl From<bool> for u16
[src]
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);
impl From<i8> for AtomicI8
[src]
impl From<bool> for i8
[src]
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);
impl From<NonZeroIsize> for isize
[src]
pub fn from(nonzero: NonZeroIsize) -> isize
[src]
Converts a NonZeroIsize
into an isize
impl From<NonZeroU16> for NonZeroI128
[src]
Converts NonZeroU16
to NonZeroI128
losslessly.
pub fn from(small: NonZeroU16) -> NonZeroI128
[src]
impl From<i32> for f64
[src]
Converts i32
to f64
losslessly.
impl From<isize> for AtomicIsize
[src]
pub fn from(v: isize) -> AtomicIsize
[src]
Converts an isize
into an AtomicIsize
.
impl<T> From<T> for UnsafeCell<T>
[src]
pub fn from(t: T) -> UnsafeCell<T>
[src]
impl From<bool> for i16
[src]
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);
impl From<i64> for AtomicI64
[src]
impl From<bool> for i64
[src]
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);
impl From<u16> for u64
[src]
Converts u16
to u64
losslessly.
impl From<i32> for AtomicI32
[src]
impl From<u16> for i32
[src]
Converts u16
to i32
losslessly.
impl From<u8> for usize
[src]
Converts u8
to usize
losslessly.
impl From<u16> for f64
[src]
Converts u16
to f64
losslessly.
impl From<u64> for i128
[src]
Converts u64
to i128
losslessly.
impl From<bool> for usize
[src]
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);
impl From<NonZeroU32> for NonZeroI128
[src]
Converts NonZeroU32
to NonZeroI128
losslessly.
pub fn from(small: NonZeroU32) -> NonZeroI128
[src]
impl From<NonZeroU16> for NonZeroU128
[src]
Converts NonZeroU16
to NonZeroU128
losslessly.
pub fn from(small: NonZeroU16) -> NonZeroU128
[src]
impl From<u16> for usize
[src]
Converts u16
to usize
losslessly.
impl From<NonZeroI8> for NonZeroIsize
[src]
Converts NonZeroI8
to NonZeroIsize
losslessly.
pub fn from(small: NonZeroI8) -> NonZeroIsize
[src]
impl From<u8> for f32
[src]
Converts u8
to f32
losslessly.
impl From<u32> for f64
[src]
Converts u32
to f64
losslessly.
impl From<u8> for char
[src]
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<NonZeroU128> for u128
[src]
pub fn from(nonzero: NonZeroU128) -> u128
[src]
Converts a NonZeroU128
into an u128
impl From<u8> for i64
[src]
Converts u8
to i64
losslessly.
impl From<u32> for i64
[src]
Converts u32
to i64
losslessly.
impl From<u64> for u128
[src]
Converts u64
to u128
losslessly.
impl<T> From<T> for RefCell<T>
[src]
impl From<NonZeroI16> for NonZeroIsize
[src]
Converts NonZeroI16
to NonZeroIsize
losslessly.
pub fn from(small: NonZeroI16) -> NonZeroIsize
[src]
impl From<NonZeroU8> for NonZeroI128
[src]
Converts NonZeroU8
to NonZeroI128
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroI128
[src]
impl From<NonZeroU64> for NonZeroU128
[src]
Converts NonZeroU64
to NonZeroU128
losslessly.
pub fn from(small: NonZeroU64) -> NonZeroU128
[src]
impl From<NonZeroI16> for NonZeroI128
[src]
Converts NonZeroI16
to NonZeroI128
losslessly.
pub fn from(small: NonZeroI16) -> NonZeroI128
[src]
impl From<NonZeroI8> for i8
[src]
impl From<u8> for AtomicU8
[src]
impl From<bool> for u8
[src]
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);
impl From<u8> for i16
[src]
Converts u8
to i16
losslessly.
impl From<u64> for AtomicU64
[src]
impl From<i16> for AtomicI16
[src]
impl From<NonZeroU64> for u64
[src]
pub fn from(nonzero: NonZeroU64) -> u64
[src]
Converts a NonZeroU64
into an u64
impl From<!> for TryFromIntError
[src]
pub fn from(never: !) -> TryFromIntError
[src]
impl From<u8> for i32
[src]
Converts u8
to i32
losslessly.
impl<T> From<T> for OnceCell<T>
[src]
impl From<u8> for f64
[src]
Converts u8
to f64
losslessly.
impl From<u16> for u32
[src]
Converts u16
to u32
losslessly.
impl From<u8> for u64
[src]
Converts u8
to u64
losslessly.
impl From<NonZeroI64> for NonZeroI128
[src]
Converts NonZeroI64
to NonZeroI128
losslessly.
pub fn from(small: NonZeroI64) -> NonZeroI128
[src]
impl From<NonZeroU8> for NonZeroUsize
[src]
Converts NonZeroU8
to NonZeroUsize
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroUsize
[src]
impl<T> From<T> for Poll<T>
[src]
impl<'_, T> From<&'_ T> for NonNull<T> where
T: ?Sized,
[src]
T: ?Sized,
impl From<i16> for i32
[src]
Converts i16
to i32
losslessly.
impl From<NonZeroI32> for NonZeroI64
[src]
Converts NonZeroI32
to NonZeroI64
losslessly.
pub fn from(small: NonZeroI32) -> NonZeroI64
[src]
impl From<!> for Infallible
[src]
pub fn from(x: !) -> Infallible
[src]
impl From<NonZeroU8> for NonZeroI16
[src]
Converts NonZeroU8
to NonZeroI16
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroI16
[src]
impl From<Infallible> for TryFromIntError
[src]
pub fn from(x: Infallible) -> TryFromIntError
[src]
impl From<NonZeroU8> for NonZeroU64
[src]
Converts NonZeroU8
to NonZeroU64
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroU64
[src]
impl<T> From<Unique<T>> for NonNull<T> where
T: ?Sized,
[src]
T: ?Sized,
impl From<NonZeroI8> for NonZeroI32
[src]
Converts NonZeroI8
to NonZeroI32
losslessly.
pub fn from(small: NonZeroI8) -> NonZeroI32
[src]
impl From<u8> for u32
[src]
Converts u8
to u32
losslessly.
impl From<bool> for AtomicBool
[src]
pub fn from(b: bool) -> AtomicBool
[src]
Converts a bool
into an AtomicBool
.
Examples
use std::sync::atomic::AtomicBool; let atomic_bool = AtomicBool::from(true); assert_eq!(format!("{:?}", atomic_bool), "true")
impl From<bool> for u32
[src]
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);
impl From<NonZeroU8> for u8
[src]
impl From<i16> for isize
[src]
Converts i16
to isize
losslessly.
impl From<NonZeroI8> for NonZeroI64
[src]
Converts NonZeroI8
to NonZeroI64
losslessly.
pub fn from(small: NonZeroI8) -> NonZeroI64
[src]
impl From<bool> for i32
[src]
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);
impl<T> From<T> for Cell<T>
[src]
impl From<NonZeroU8> for NonZeroU32
[src]
Converts NonZeroU8
to NonZeroU32
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroU32
[src]
impl From<NonZeroU8> for NonZeroI32
[src]
Converts NonZeroU8
to NonZeroI32
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroI32
[src]
impl<'_, T> From<&'_ mut T> for NonNull<T> where
T: ?Sized,
[src]
T: ?Sized,
impl From<NonZeroI16> for NonZeroI32
[src]
Converts NonZeroI16
to NonZeroI32
losslessly.
pub fn from(small: NonZeroI16) -> NonZeroI32
[src]
impl From<u32> for i128
[src]
Converts u32
to i128
losslessly.
impl From<bool> for u64
[src]
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);
impl From<NonZeroI64> for i64
[src]
pub fn from(nonzero: NonZeroI64) -> i64
[src]
Converts a NonZeroI64
into an i64
impl From<NonZeroI8> for NonZeroI128
[src]
Converts NonZeroI8
to NonZeroI128
losslessly.
pub fn from(small: NonZeroI8) -> NonZeroI128
[src]
impl From<i8> for i32
[src]
Converts i8
to i32
losslessly.
impl From<NonZeroU32> for NonZeroU64
[src]
Converts NonZeroU32
to NonZeroU64
losslessly.
pub fn from(small: NonZeroU32) -> NonZeroU64
[src]
impl From<NonZeroU32> for NonZeroI64
[src]
Converts NonZeroU32
to NonZeroI64
losslessly.
pub fn from(small: NonZeroU32) -> NonZeroI64
[src]
impl From<NonZeroI16> for i16
[src]
pub fn from(nonzero: NonZeroI16) -> i16
[src]
Converts a NonZeroI16
into an i16
impl From<NonZeroU16> for NonZeroI32
[src]
Converts NonZeroU16
to NonZeroI32
losslessly.
pub fn from(small: NonZeroU16) -> NonZeroI32
[src]
impl From<u8> for isize
[src]
Converts u8
to isize
losslessly.
impl From<NonZeroU16> for NonZeroUsize
[src]
Converts NonZeroU16
to NonZeroUsize
losslessly.
pub fn from(small: NonZeroU16) -> NonZeroUsize
[src]
impl From<NonZeroU8> for NonZeroU16
[src]
Converts NonZeroU8
to NonZeroU16
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroU16
[src]
impl From<NonZeroU32> for NonZeroU128
[src]
Converts NonZeroU32
to NonZeroU128
losslessly.
pub fn from(small: NonZeroU32) -> NonZeroU128
[src]
impl From<NonZeroUsize> for usize
[src]
pub fn from(nonzero: NonZeroUsize) -> usize
[src]
Converts a NonZeroUsize
into an usize
impl From<Infallible> for TryFromSliceError
[src]
pub fn from(x: Infallible) -> TryFromSliceError
[src]
impl From<u16> for i64
[src]
Converts u16
to i64
losslessly.
impl From<i16> for i128
[src]
Converts i16
to i128
losslessly.
impl From<u16> for i128
[src]
Converts u16
to i128
losslessly.
impl From<u8> for i128
[src]
Converts u8
to i128
losslessly.
impl From<bool> for isize
[src]
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);
impl From<usize> for AtomicUsize
[src]
pub fn from(v: usize) -> AtomicUsize
[src]
Converts an usize
into an AtomicUsize
.
impl From<i8> for f64
[src]
Converts i8
to f64
losslessly.
impl From<u8> for u128
[src]
Converts u8
to u128
losslessly.
impl From<NonZeroU16> for NonZeroI64
[src]
Converts NonZeroU16
to NonZeroI64
losslessly.
pub fn from(small: NonZeroU16) -> NonZeroI64
[src]
impl From<i8> for i64
[src]
Converts i8
to i64
losslessly.
impl From<NonZeroI32> for i32
[src]
pub fn from(nonzero: NonZeroI32) -> i32
[src]
Converts a NonZeroI32
into an i32
impl From<i16> for i64
[src]
Converts i16
to i64
losslessly.
impl From<i8> for f32
[src]
Converts i8
to f32
losslessly.
impl From<NonZeroU8> for NonZeroIsize
[src]
Converts NonZeroU8
to NonZeroIsize
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroIsize
[src]
impl From<NonZeroU32> for u32
[src]
pub fn from(nonzero: NonZeroU32) -> u32
[src]
Converts a NonZeroU32
into an u32
impl From<i64> for i128
[src]
Converts i64
to i128
losslessly.
impl From<NonZeroI128> for i128
[src]
pub fn from(nonzero: NonZeroI128) -> i128
[src]
Converts a NonZeroI128
into an i128
impl From<NonZeroI32> for NonZeroI128
[src]
Converts NonZeroI32
to NonZeroI128
losslessly.
pub fn from(small: NonZeroI32) -> NonZeroI128
[src]
impl From<NonZeroU8> for NonZeroI64
[src]
Converts NonZeroU8
to NonZeroI64
losslessly.
pub fn from(small: NonZeroU8) -> NonZeroI64
[src]
impl From<NonZeroU16> for NonZeroU32
[src]
Converts NonZeroU16
to NonZeroU32
losslessly.
pub fn from(small: NonZeroU16) -> NonZeroU32
[src]
impl From<bool> for u128
[src]
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);
impl From<u16> for AtomicU16
[src]
impl From<i8> for i16
[src]
Converts i8
to i16
losslessly.
impl From<u32> for u64
[src]
Converts u32
to u64
losslessly.
impl From<i8> for i128
[src]
Converts i8
to i128
losslessly.
impl From<NonZeroU16> for u16
[src]
pub fn from(nonzero: NonZeroU16) -> u16
[src]
Converts a NonZeroU16
into an u16
impl From<i16> for f32
[src]
Converts i16
to f32
losslessly.
impl From<u32> for u128
[src]
Converts u32
to u128
losslessly.
impl From<u16> for u128
[src]
Converts u16
to u128
losslessly.
impl From<u32> for AtomicU32
[src]
impl<T> From<*mut T> for AtomicPtr<T>
[src]
impl From<i8> for isize
[src]
Converts i8
to isize
losslessly.
impl From<u16> for f32
[src]
Converts u16
to f32
losslessly.
impl From<u8> for u16
[src]
Converts u8
to u16
losslessly.
impl From<char> for u32
[src]
impl From<i16> for f64
[src]
Converts i16
to f64
losslessly.
impl From<i32> for i64
[src]
Converts i32
to i64
losslessly.
impl From<bool> for i128
[src]
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);
impl From<NonZeroU16> for NonZeroU64
[src]
Converts NonZeroU16
to NonZeroU64
losslessly.
pub fn from(small: NonZeroU16) -> NonZeroU64
[src]
impl<T> From<Vec<T>> for Rc<[T]>
[src]
impl<W> From<Arc<W>> for RawWaker where
W: 'static + Wake + Send + Sync,
[src]
W: 'static + Wake + Send + Sync,
impl<'a, B> From<Cow<'a, B>> for Rc<B> where
B: ToOwned + ?Sized,
Rc<B>: From<&'a B>,
Rc<B>: From<<B as ToOwned>::Owned>,
[src]
B: ToOwned + ?Sized,
Rc<B>: From<&'a B>,
Rc<B>: From<<B as ToOwned>::Owned>,
impl<'a, T> From<&'a Vec<T>> for Cow<'a, [T]> where
T: Clone,
[src]
T: Clone,
impl<'_> From<&'_ String> for String
[src]
impl<T> From<Box<T>> for Rc<T> where
T: ?Sized,
[src]
T: ?Sized,
impl From<String> for Rc<str>
[src]
impl<'a> From<&'a str> for Cow<'a, str>
[src]
impl<T> From<Box<T>> for Pin<Box<T>> where
T: ?Sized,
[src]
T: ?Sized,
pub fn from(boxed: Box<T>) -> Pin<Box<T>>
[src]
Converts a Box<T>
into a Pin<Box<T>>
This conversion does not allocate on the heap and happens in place.
impl<W> From<Arc<W>> for Waker where
W: 'static + Wake + Send + Sync,
[src]
W: 'static + Wake + Send + Sync,
impl<'_> From<&'_ mut str> for String
[src]
pub fn from(s: &mut str) -> String
[src]
Converts a &mut str
into a String
.
The result is allocated on the heap.
impl<'_, T> From<&'_ [T]> for Rc<[T]> where
T: Clone,
[src]
T: Clone,
impl<'_> From<&'_ str> for Rc<str>
[src]
impl<'a> From<&'a String> for Cow<'a, str>
[src]
impl From<char> for String
[src]
impl<T> From<Vec<T>> for BinaryHeap<T> where
T: Ord,
[src]
T: Ord,
pub fn from(vec: Vec<T>) -> BinaryHeap<T>
[src]
Converts a Vec<T>
into a BinaryHeap<T>
.
This conversion happens in-place, and has O(n) time complexity.
impl<'a, T> From<&'a [T]> for Cow<'a, [T]> where
T: Clone,
[src]
T: Clone,
impl<'a, T> From<Vec<T>> for Cow<'a, [T]> where
T: Clone,
[src]
T: Clone,
impl<'a> From<String> for Cow<'a, str>
[src]
impl<'_> From<&'_ str> for String
[src]
impl<'a> From<Cow<'a, str>> for String
[src]
impl<T> From<Vec<T>> for VecDeque<T>
[src]
pub fn from(other: Vec<T>) -> VecDeque<T>
[src]
Turn a Vec<T>
into a VecDeque<T>
.
This avoids reallocating where possible, but the conditions for that are
strict, and subject to change, and so shouldn't be relied upon unless the
Vec<T>
came from From<VecDeque<T>>
and hasn't been reallocated.
impl From<LayoutErr> for TryReserveError
[src]
pub fn from(LayoutErr) -> TryReserveError
[src]
impl<T> From<T> for Rc<T>
[src]
impl From<Box<str>> for String
[src]
pub fn from(s: Box<str>) -> String
[src]
Converts the given boxed str
slice to a String
.
It is notable that the str
slice is owned.
Examples
Basic usage:
let s1: String = String::from("hello world"); let s2: Box<str> = s1.into_boxed_str(); let s3: String = String::from(s2); assert_eq!("hello world", s3)
impl<T> From<HashSet<T, RandomState>> for AHashSet<T, RandomState>
impl<K, V> From<HashMap<K, V, RandomState>> for AHashMap<K, V, RandomState>
impl From<NonZeroU32> for Error
[src]
pub fn from(code: NonZeroU32) -> Error
[src]
impl<T> From<T> for CachePadded<T>
pub fn from(t: T) -> CachePadded<T>
impl<R, T> From<T> for Mutex<R, T> where
R: RawMutex,
R: RawMutex,
pub fn from(t: T) -> Mutex<R, T>
impl<R, T> From<T> for RwLock<R, T> where
R: RawRwLock,
R: RawRwLock,
pub fn from(t: T) -> RwLock<R, T>
impl<R, G, T> From<T> for ReentrantMutex<R, G, T> where
G: GetThreadId,
R: RawMutex,
G: GetThreadId,
R: RawMutex,
pub fn from(t: T) -> ReentrantMutex<R, G, T>
impl<A> From<A> for SmallVec<A> where
A: Array,
A: Array,
pub fn from(array: A) -> SmallVec<A>
impl<'a, A> From<&'a [<A as Array>::Item]> for SmallVec<A> where
A: Array,
<A as Array>::Item: Clone,
A: Array,
<A as Array>::Item: Clone,
impl<A> From<Vec<<A as Array>::Item>> for SmallVec<A> where
A: Array,
A: Array,
impl From<LayoutErr> for CollectionAllocErr
impl<X> From<RangeInclusive<X>> for Uniform<X> where
X: SampleUniform,
[src]
X: SampleUniform,
pub fn from(r: RangeInclusive<X>) -> Uniform<X>
[src]
impl<X> From<Range<X>> for Uniform<X> where
X: SampleUniform,
[src]
X: SampleUniform,
impl From<Vec<u32>> for IndexVec
[src]
impl From<Vec<usize>> for IndexVec
[src]
impl From<NonZeroU32> for Error
[src]
pub fn from(code: NonZeroU32) -> Error
[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl From<NonZeroU32> for Error
[src]
pub fn from(code: NonZeroU32) -> Error
[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl From<ChaCha20Core> for ChaCha20Rng
[src]
pub fn from(core: ChaCha20Core) -> ChaCha20Rng
[src]
impl From<ChaCha12Core> for ChaCha12Rng
[src]
pub fn from(core: ChaCha12Core) -> ChaCha12Rng
[src]
impl From<ChaCha8Core> for ChaCha8Rng
[src]
pub fn from(core: ChaCha8Core) -> ChaCha8Rng
[src]
impl<W> From<x4<W>> for vec512_storage where
W: Copy,
vec128_storage: From<W>,
W: Copy,
vec128_storage: From<W>,
pub fn from(x: x4<W>) -> vec512_storage
impl<NI> From<u32x4x4_avx2<NI>> for vec512_storage
pub fn from(x: u32x4x4_avx2<NI>) -> vec512_storage
impl<W, G> From<x2<W, G>> for vec256_storage where
W: Copy,
vec128_storage: From<W>,
W: Copy,
vec128_storage: From<W>,
pub fn from(x: x2<W, G>) -> vec256_storage
impl<S3, S4, NI> From<u128x1_sse2<S3, S4, NI>> for vec128_storage
pub fn from(x: u128x1_sse2<S3, S4, NI>) -> vec128_storage
impl<S3, S4, NI> From<u32x4_sse2<S3, S4, NI>> for vec128_storage
pub fn from(x: u32x4_sse2<S3, S4, NI>) -> vec128_storage
impl<S3, S4, NI> From<u64x2_sse2<S3, S4, NI>> for vec128_storage
pub fn from(x: u64x2_sse2<S3, S4, NI>) -> vec128_storage
impl<E> From<E> for Error where
E: Error + Send + Sync + 'static,
[src]
E: Error + Send + Sync + 'static,
impl<T> From<SendError<T>> for TrySendError<T>
pub fn from(err: SendError<T>) -> TrySendError<T>
impl From<RecvError> for TryRecvError
pub fn from(err: RecvError) -> TryRecvError
impl<T> From<SendError<T>> for SendTimeoutError<T>
pub fn from(err: SendError<T>) -> SendTimeoutError<T>
impl From<RecvError> for RecvTimeoutError
pub fn from(err: RecvError) -> RecvTimeoutError
impl<T> From<T> for CachePadded<T>
pub fn from(t: T) -> CachePadded<T>
impl<T> From<T> for ShardedLock<T>
pub fn from(t: T) -> ShardedLock<T>
impl From<Uuid> for Simple
[src]
impl From<Error> for Error
[src]
impl<'a> From<&'a Uuid> for SimpleRef<'a>
[src]
impl From<Uuid> for Hyphenated
[src]
pub fn from(f: Uuid) -> Hyphenated
[src]
impl From<Error> for Error
[src]
impl<'a> From<&'a Uuid> for HyphenatedRef<'a>
[src]
pub fn from(f: &'a Uuid) -> HyphenatedRef<'a>
[src]
impl From<Uuid> for Urn
[src]
impl<'a> From<&'a Uuid> for UrnRef<'a>
[src]
impl From<Quat> for [f32; 4]
[src]
impl From<Vec3AMask> for [u32; 3]
[src]
impl From<Vec4> for __m128
[src]
impl From<Vec3A> for (f32, f32, f32)
[src]
impl From<Vec2Mask> for [u32; 2]
[src]
impl From<Vec4> for [f32; 4]
[src]
impl From<Vec3> for [f32; 3]
[src]
impl From<Vec3AMask> for __m128
[src]
impl From<Vec3A> for __m128
[src]
impl From<Vec4Mask> for [u32; 4]
[src]
impl From<Quat> for __m128
[src]
impl From<Quat> for (f32, f32, f32, f32)
[src]
impl From<Vec4Mask> for __m128
[src]
impl From<Vec3A> for [f32; 3]
[src]
impl From<Vec2> for [f32; 2]
[src]
impl From<Vec3> for (f32, f32, f32)
[src]
impl From<Vec2> for (f32, f32)
[src]
impl From<Vec3Mask> for [u32; 3]
[src]
impl From<Vec4> for (f32, f32, f32, f32)
[src]
impl From<f64> for Number
[src]
impl From<u64> for Number
[src]
impl From<FromUtf8Error> for ErrorCode
[src]
pub fn from(e: FromUtf8Error) -> ErrorCode
[src]
impl From<Error> for Error
[src]
impl From<Utf8Error> for Error
[src]
impl From<i32> for Number
[src]
impl From<Utf8Error> for ErrorCode
[src]
impl From<i64> for Number
[src]
impl From<Error> for Error
impl<T> From<SendError<T>> for Error
pub fn from(err: SendError<T>) -> Error
impl From<RecvError> for Error
pub fn from(err: RecvError) -> Error
impl<T> From<SendError<T>> for Error
pub fn from(err: SendError<T>) -> Error
impl<T> From<PoisonError<T>> for Error
pub fn from(err: PoisonError<T>) -> Error
impl From<Error> for Error
pub fn from(walk_err: Error) -> Error
Convert the Error
to an io::Error
, preserving the original
Error
as the "inner error". Note that this also makes the display
of the error include the context.
This is different from into_io_error
which returns the original
io::Error
.
impl From<SystemTime> for FileTime
pub fn from(time: SystemTime) -> FileTime
impl From<Token> for usize
[src]
impl From<Ready> for UnixReady
[src]
impl From<ReadinessState> for usize
[src]
impl From<UnixReady> for Ready
[src]
impl From<usize> for Token
[src]
impl<T> From<Error> for TrySendError<T>
impl<T> From<SendError<T>> for SendError<T>
impl<T> From<TrySendError<T>> for TrySendError<T>
pub fn from(src: TrySendError<T>) -> TrySendError<T>
impl<T> From<Error> for SendError<T>
impl<T> From<SendError<T>> for TrySendError<T>
impl<'a, T, L> From<T> for Labels where
L: Into<Cow<'static, str>>,
T: IntoIterator<Item = L>,
L: Into<Cow<'static, str>>,
T: IntoIterator<Item = L>,
pub fn from(value: T) -> Labels
impl<'_> From<&'_ TouchInput> for Touch
pub fn from(input: &TouchInput) -> Touch
impl From<PlayStreamError> for StreamError
pub fn from(err: PlayStreamError) -> StreamError
impl From<DecoderError> for PlayError
pub fn from(err: DecoderError) -> PlayError
impl From<DeviceInner> for Device
pub fn from(d: DeviceInner) -> Device
impl From<Host> for Host
pub fn from(h: Host) -> Host
impl From<BackendSpecificError> for DevicesError
pub fn from(source: BackendSpecificError) -> DevicesError
impl From<Device> for Device
pub fn from(h: Device) -> Device
impl From<DevicesInner> for Devices
pub fn from(d: DevicesInner) -> Devicesⓘ
impl From<Error> for StreamError
pub fn from(err: Error) -> StreamError
impl From<Error> for DevicesError
pub fn from(err: Error) -> DevicesError
impl From<Error> for PauseStreamError
pub fn from(err: Error) -> PauseStreamError
impl From<SupportedStreamConfig> for StreamConfig
pub fn from(conf: SupportedStreamConfig) -> StreamConfig
impl From<Stream> for Stream
pub fn from(h: Stream) -> Stream
impl From<Devices> for Devices
pub fn from(h: Devices) -> Devicesⓘ
impl From<Error> for BackendSpecificError
pub fn from(err: Error) -> BackendSpecificError
impl From<BackendSpecificError> for PlayStreamError
pub fn from(source: BackendSpecificError) -> PlayStreamError
impl From<BackendSpecificError> for DeviceNameError
pub fn from(source: BackendSpecificError) -> DeviceNameError
impl From<BackendSpecificError> for SupportedStreamConfigsError
pub fn from(source: BackendSpecificError) -> SupportedStreamConfigsError
impl From<BackendSpecificError> for DefaultStreamConfigError
pub fn from(source: BackendSpecificError) -> DefaultStreamConfigError
impl From<Error> for BuildStreamError
pub fn from(err: Error) -> BuildStreamError
impl From<BackendSpecificError> for BuildStreamError
pub fn from(source: BackendSpecificError) -> BuildStreamError
impl From<BackendSpecificError> for StreamError
pub fn from(source: BackendSpecificError) -> StreamError
impl From<StreamInner> for Stream
pub fn from(s: StreamInner) -> Stream
impl From<HostInner> for Host
pub fn from(h: HostInner) -> Host
impl From<BackendSpecificError> for PauseStreamError
pub fn from(source: BackendSpecificError) -> PauseStreamError
impl From<Error> for SupportedStreamConfigsError
pub fn from(err: Error) -> SupportedStreamConfigsError
impl From<Error> for PlayStreamError
pub fn from(err: Error) -> PlayStreamError
impl<'a> From<&'a [ChmapPosition]> for Chmap
impl From<Error> for Error
impl From<timeval> for TimeVal
pub fn from(tv: timeval) -> TimeVal
impl From<ucred> for UnixCredentials
pub fn from(cred: ucred) -> UnixCredentials
impl<'a> From<Vec<AioCb<'a>>> for LioCb<'a>
impl<'a> From<&'a sigevent> for SigEvent
pub fn from(sigevent: &sigevent) -> SigEvent
impl From<Uid> for u32
impl From<Pid> for i32
impl From<Gid> for u32
impl From<u32> for BaudRate
impl From<Errno> for Error
pub fn from(errno: Errno) -> Error
impl From<Termios> for termios
pub fn from(termios: Termios) -> termios
impl From<termios> for Termios
pub fn from(termios: termios) -> Termios
impl From<FromUtf8Error> for Error
pub fn from(FromUtf8Error) -> Error
impl From<Errno> for Error
impl From<Error> for Error
impl<'a, T> From<&'a [T]> for SliceDeque<T> where
T: Clone,
T: Clone,
impl<'a, T> From<&'a mut [T]> for SliceDeque<T> where
T: Clone,
T: Clone,
pub fn from(s: &'a mut [T]) -> SliceDeque<T>
impl From<Error> for GltfError
pub fn from(source: Error) -> GltfError
impl From<DecodeError> for GltfError
pub fn from(source: DecodeError) -> GltfError
impl From<ImageError> for GltfError
pub fn from(source: ImageError) -> GltfError
impl From<AssetIoError> for GltfError
pub fn from(source: AssetIoError) -> GltfError
impl From<Handle<Texture>> for StandardMaterial
impl From<Color> for StandardMaterial
impl From<Color> for [f32; 4]
impl From<i32> for ReflectOp
impl From<i32> for ReflectBuiltIn
impl From<Delay> for Duration
impl<'_> From<&'_ Path> for ImageFormatHint
impl From<Error> for ImageError
pub fn from(error: Error) -> ImageError
impl<T> From<[T; 4]> for Bgra<T> where
T: 'static + Primitive,
T: 'static + Primitive,
impl<T> From<[T; 4]> for Rgba<T> where
T: 'static + Primitive,
T: 'static + Primitive,
impl<T> From<[T; 2]> for LumaA<T> where
T: 'static + Primitive,
T: 'static + Primitive,
impl From<Error> for ImageError
impl From<ImageFormatHint> for UnsupportedError
pub fn from(hint: ImageFormatHint) -> UnsupportedError
impl From<ColorType> for ExtendedColorType
pub fn from(c: ColorType) -> ExtendedColorType
impl From<NeuQuant> for NeuQuant
pub fn from(inner: NeuQuant) -> NeuQuant
impl From<ImageFormat> for ImageOutputFormat
pub fn from(fmt: ImageFormat) -> ImageOutputFormat
impl From<PathError> for ImageError
pub fn from(path: PathError) -> ImageError
impl From<DecoderError> for ImageError
pub fn from(e: DecoderError) -> ImageError
impl From<NeuQuant> for NeuQuant
pub fn from(this: NeuQuant) -> NeuQuant
impl<T> From<[T; 3]> for Bgr<T> where
T: 'static + Primitive,
T: 'static + Primitive,
impl From<ImageFormat> for ImageFormatHint
pub fn from(format: ImageFormat) -> ImageFormatHint
impl<T> From<[T; 1]> for Luma<T> where
T: 'static + Primitive,
T: 'static + Primitive,
impl<T> From<[T; 3]> for Rgb<T> where
T: 'static + Primitive,
T: 'static + Primitive,
impl<T> From<T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<T> From<(T, T)> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl From<String> for DecodingError
impl From<Error> for DecodingError
impl From<Error> for EncodingError
impl From<EncodingError> for Error
impl From<Compression> for Compression
pub fn from(c: Compression) -> Compression
impl From<Compression> for CompressionOptions
pub fn from(c: Compression) -> CompressionOptions
impl From<DecodingError> for Error
impl From<Compression> for CompressionOptions
pub fn from(compression: Compression) -> CompressionOptions
impl From<MZFlush> for TDEFLFlush
pub fn from(flush: MZFlush) -> TDEFLFlush
impl From<Error> for Error
pub fn from(err: Error) -> Error
impl From<Error> for Error
impl From<Error> for Error
impl From<Vec<(Path, Error)>> for Error
impl From<u64> for Number
[src]
impl From<isize> for Number
[src]
impl From<i64> for Number
[src]
impl From<u16> for Number
[src]
impl From<i8> for Value
[src]
impl From<u32> for Number
[src]
impl From<i16> for Value
[src]
impl From<i64> for Value
[src]
impl From<()> for Value
[src]
impl From<Error> for Error
[src]
pub fn from(j: Error) -> Error
[src]
Convert a serde_json::Error
into an io::Error
.
JSON syntax and data errors are turned into InvalidData
IO errors.
EOF errors are turned into UnexpectedEof
IO errors.
use std::io; enum MyError { Io(io::Error), Json(serde_json::Error), } impl From<serde_json::Error> for MyError { fn from(err: serde_json::Error) -> MyError { use serde_json::error::Category; match err.classify() { Category::Io => { MyError::Io(err.into()) } Category::Syntax | Category::Data | Category::Eof => { MyError::Json(err) } } } }
impl From<Map<String, Value>> for Value
[src]
pub fn from(f: Map<String, Value>) -> Value
[src]
Convert map (with string keys) to Value
Examples
use serde_json::{Map, Value}; let mut m = Map::new(); m.insert("Lorem".to_string(), "ipsum".into()); let x: Value = m.into();
impl From<i16> for Number
[src]
impl From<isize> for Value
[src]
impl From<usize> for Number
[src]
impl From<String> for Value
[src]
pub fn from(f: String) -> Value
[src]
Convert String
to Value
Examples
use serde_json::Value; let s: String = "lorem".to_string(); let x: Value = s.into();
impl From<u16> for Value
[src]
impl From<bool> for Value
[src]
impl From<i32> for Number
[src]
impl From<u8> for Value
[src]
impl<'a> From<Cow<'a, str>> for Value
[src]
pub fn from(f: Cow<'a, str>) -> Value
[src]
Convert copy-on-write string to Value
Examples
use serde_json::Value; use std::borrow::Cow; let s: Cow<str> = Cow::Borrowed("lorem"); let x: Value = s.into();
use serde_json::Value; use std::borrow::Cow; let s: Cow<str> = Cow::Owned("lorem".to_string()); let x: Value = s.into();
impl From<u64> for Value
[src]
impl<T> From<Vec<T>> for Value where
T: Into<Value>,
[src]
T: Into<Value>,
pub fn from(f: Vec<T>) -> Value
[src]
Convert a Vec
to Value
Examples
use serde_json::Value; let v = vec!["lorem", "ipsum", "dolor"]; let x: Value = v.into();
impl<'a> From<&'a str> for Value
[src]
pub fn from(f: &str) -> Value
[src]
Convert string slice to Value
Examples
use serde_json::Value; let s: &str = "lorem"; let x: Value = s.into();
impl From<i8> for Number
[src]
impl From<f32> for Value
[src]
pub fn from(f: f32) -> Value
[src]
Convert 32-bit floating point number to Value
Examples
use serde_json::Value; let f: f32 = 13.37; let x: Value = f.into();
impl From<f64> for Value
[src]
pub fn from(f: f64) -> Value
[src]
Convert 64-bit floating point number to Value
Examples
use serde_json::Value; let f: f64 = 13.37; let x: Value = f.into();
impl From<u32> for Value
[src]
impl<'a, T> From<&'a [T]> for Value where
T: Clone + Into<Value>,
[src]
T: Clone + Into<Value>,
pub fn from(f: &'a [T]) -> Value
[src]
Convert a slice to Value
Examples
use serde_json::Value; let v: &[&str] = &["lorem", "ipsum", "dolor"]; let x: Value = v.into();
impl From<ParserNumber> for Number
[src]
impl From<i32> for Value
[src]
impl From<usize> for Value
[src]
impl From<u8> for Number
[src]
impl<T, U> From<[T; 2]> for Vector2D<T, U>
impl<T, U> From<(T, T)> for Size2D<T, U>
impl<T, U> From<Size2D<T, U>> for Rect<T, U> where
T: Zero,
T: Zero,
pub fn from(size: Size2D<T, U>) -> Rect<T, U>
impl<T, Src, Dst> From<Rotation3D<T, Src, Dst>> for RigidTransform3D<T, Src, Dst> where
T: ApproxEq<T> + Float,
T: ApproxEq<T> + Float,
pub fn from(rot: Rotation3D<T, Src, Dst>) -> RigidTransform3D<T, Src, Dst>
impl<T, U> From<Point3D<T, U>> for HomogeneousVector<T, U> where
T: One,
T: One,
pub fn from(p: Point3D<T, U>) -> HomogeneousVector<T, U>
impl<T, U> From<Size2D<T, U>> for Vector2D<T, U>
pub fn from(size: Size2D<T, U>) -> Vector2D<T, U>
impl<T, U> From<[T; 3]> for Point3D<T, U>
impl<T, U> From<Size2D<T, U>> for Box2D<T, U> where
T: Copy + Zero + PartialOrd<T>,
T: Copy + Zero + PartialOrd<T>,
pub fn from(b: Size2D<T, U>) -> Box2D<T, U>
impl<T, U> From<[T; 3]> for Size3D<T, U>
impl<T, U> From<Vector3D<T, U>> for HomogeneousVector<T, U> where
T: Zero,
T: Zero,
pub fn from(v: Vector3D<T, U>) -> HomogeneousVector<T, U>
impl<T, U> From<[T; 2]> for Size2D<T, U>
impl<T, U> From<[T; 3]> for Vector3D<T, U>
impl<T, U> From<(T, T)> for Vector2D<T, U>
impl<T, U> From<Vector2D<T, U>> for Size2D<T, U>
pub fn from(v: Vector2D<T, U>) -> Size2D<T, U>
impl<T, Src, Dst> From<Vector3D<T, Dst>> for RigidTransform3D<T, Src, Dst> where
T: ApproxEq<T> + Float,
T: ApproxEq<T> + Float,
pub fn from(t: Vector3D<T, Dst>) -> RigidTransform3D<T, Src, Dst>
impl<T, U> From<(T, T, T)> for Size3D<T, U>
impl<T, U> From<Point2D<T, U>> for HomogeneousVector<T, U> where
T: Zero + One,
T: Zero + One,
pub fn from(p: Point2D<T, U>) -> HomogeneousVector<T, U>
impl<T, U> From<[T; 2]> for Point2D<T, U>
impl<T, U> From<(T, T, T)> for Point3D<T, U>
impl<T, U> From<(T, T, T)> for Vector3D<T, U>
impl<T, Src, Dst> From<Vector2D<T, Src>> for Translation2D<T, Src, Dst>
pub fn from(v: Vector2D<T, Src>) -> Translation2D<T, Src, Dst>
impl<T, U> From<Size3D<T, U>> for Box3D<T, U> where
T: Copy + Zero + PartialOrd<T>,
T: Copy + Zero + PartialOrd<T>,
pub fn from(b: Size3D<T, U>) -> Box3D<T, U>
impl<T, Src, Dst> From<Vector3D<T, Src>> for Translation3D<T, Src, Dst>
pub fn from(v: Vector3D<T, Src>) -> Translation3D<T, Src, Dst>
impl<T, U> From<Vector2D<T, U>> for HomogeneousVector<T, U> where
T: Zero,
T: Zero,
pub fn from(v: Vector2D<T, U>) -> HomogeneousVector<T, U>
impl<T, U> From<Vector3D<T, U>> for Size3D<T, U>
pub fn from(v: Vector3D<T, U>) -> Size3D<T, U>
impl<T, U> From<(T, T)> for Point2D<T, U>
impl From<Arc<dyn Font + 'static + Sync + Send>> for FontArc
impl From<FontRef<'static>> for FontArc
pub fn from(font: FontRef<'static>) -> FontArc
impl From<GlyphId> for GlyphId
impl From<f32> for PxScale
impl From<FontVec> for FontArc
pub fn from(font: FontVec) -> FontArc
impl<F> From<[F; 2]> for Point where
F: Into<f32>,
F: Into<f32>,
pub fn from([F; 2]) -> Point
let p: Point = [23_f32, 34.5].into(); let p2: Point = [5u8, 44].into();
impl<F> From<(F, F)> for Point where
F: Into<f32>,
F: Into<f32>,
pub fn from((F, F)) -> Point
let p: Point = (23_f32, 34.5_f32).into(); let p2: Point = (5u8, 44u8).into();
impl From<u16> for Weight
[src]
impl From<f32> for NormalizedCoordinate
[src]
pub fn from(n: f32) -> NormalizedCoordinate
[src]
Creates a new coordinate.
The provided number will be clamped to the -1.0..1.0 range.
impl From<i16> for NormalizedCoordinate
[src]
pub fn from(n: i16) -> NormalizedCoordinate
[src]
Creates a new coordinate.
The provided number will be clamped to the -16384..16384 range.
impl From<FlexDirection> for FlexDirection
pub fn from(value: FlexDirection) -> FlexDirection
impl From<AlignSelf> for AlignSelf
pub fn from(value: AlignSelf) -> AlignSelf
impl<'_> From<&'_ Style> for Style
pub fn from(value: &Style) -> Style
impl From<Val> for Dimension
pub fn from(val: Val) -> Dimension
impl From<Display> for Display
pub fn from(value: Display) -> Display
impl From<AlignItems> for AlignItems
pub fn from(value: AlignItems) -> AlignItems
impl From<JustifyContent> for JustifyContent
pub fn from(value: JustifyContent) -> JustifyContent
impl From<Direction> for Direction
pub fn from(value: Direction) -> Direction
impl From<AlignContent> for AlignContent
pub fn from(value: AlignContent) -> AlignContent
impl From<PositionType> for PositionType
pub fn from(value: PositionType) -> PositionType
impl From<FlexWrap> for FlexWrap
pub fn from(value: FlexWrap) -> FlexWrap
impl<P, X> From<(X, X)> for LogicalSize<P> where
P: Pixel,
X: Pixel,
P: Pixel,
X: Pixel,
impl<P> From<PhysicalPosition<P>> for Position where
P: Pixel,
P: Pixel,
pub fn from(position: PhysicalPosition<P>) -> Position
impl From<OpenError> for XNotSupported
pub fn from(err: OpenError) -> XNotSupported
impl<P> From<LogicalPosition<P>> for Position where
P: Pixel,
P: Pixel,
pub fn from(position: LogicalPosition<P>) -> Position
impl<P> From<PhysicalSize<P>> for Size where
P: Pixel,
P: Pixel,
pub fn from(size: PhysicalSize<P>) -> Size
impl<P, X> From<(X, X)> for LogicalPosition<P> where
P: Pixel,
X: Pixel,
P: Pixel,
X: Pixel,
impl<P, X> From<[X; 2]> for PhysicalSize<P> where
P: Pixel,
X: Pixel,
P: Pixel,
X: Pixel,
impl<P, X> From<[X; 2]> for LogicalPosition<P> where
P: Pixel,
X: Pixel,
P: Pixel,
X: Pixel,
impl<P, X> From<[X; 2]> for PhysicalPosition<P> where
P: Pixel,
X: Pixel,
P: Pixel,
X: Pixel,
impl<P, X> From<(X, X)> for PhysicalSize<P> where
P: Pixel,
X: Pixel,
P: Pixel,
X: Pixel,
impl<P, X> From<[X; 2]> for LogicalSize<P> where
P: Pixel,
X: Pixel,
P: Pixel,
X: Pixel,
impl From<bool> for StateOperation
impl<P> From<LogicalSize<P>> for Size where
P: Pixel,
P: Pixel,
pub fn from(size: LogicalSize<P>) -> Size
impl<P, X> From<(X, X)> for PhysicalPosition<P> where
P: Pixel,
X: Pixel,
P: Pixel,
X: Pixel,
impl<'a> From<PercentEncode<'a>> for Cow<'a, str>
impl<'a> From<PercentDecode<'a>> for Cow<'a, [u8]>
impl<'a> From<&'a XMappingEvent> for XEvent
pub fn from(other: &'a XMappingEvent) -> XEvent
impl<'a> From<&'a XF86VidModeNotifyEvent> for XEvent
pub fn from(other: &'a XF86VidModeNotifyEvent) -> XEvent
impl<'a> From<&'a XEvent> for XDestroyWindowEvent
pub fn from(xevent: &'a XEvent) -> XDestroyWindowEvent
impl From<XEvent> for XMappingEvent
pub fn from(xevent: XEvent) -> XMappingEvent
impl<'a> From<&'a XEvent> for XGravityEvent
pub fn from(xevent: &'a XEvent) -> XGravityEvent
impl<'a> From<&'a XButtonEvent> for XEvent
pub fn from(other: &'a XButtonEvent) -> XEvent
impl From<[i8; 20]> for ClientMessageData
impl<'a> From<&'a XEvent> for XMapEvent
pub fn from(xevent: &'a XEvent) -> XMapEvent
impl From<XEvent> for XConfigureEvent
pub fn from(xevent: XEvent) -> XConfigureEvent
impl From<XF86VidModeNotifyEvent> for XEvent
pub fn from(other: XF86VidModeNotifyEvent) -> XEvent
impl<'a> From<&'a XEvent> for XConfigureEvent
pub fn from(xevent: &'a XEvent) -> XConfigureEvent
impl<'a> From<&'a XScreenSaverNotifyEvent> for XEvent
pub fn from(other: &'a XScreenSaverNotifyEvent) -> XEvent
impl From<XMapEvent> for XEvent
pub fn from(other: XMapEvent) -> XEvent
impl From<XEvent> for XColormapEvent
pub fn from(xevent: XEvent) -> XColormapEvent
impl<'a> From<&'a XEvent> for XRROutputChangeNotifyEvent
pub fn from(xevent: &'a XEvent) -> XRROutputChangeNotifyEvent
impl From<XKeyEvent> for XEvent
pub fn from(other: XKeyEvent) -> XEvent
impl<'a> From<&'a XUnmapEvent> for XEvent
pub fn from(other: &'a XUnmapEvent) -> XEvent
impl<'a> From<&'a XEvent> for XMapRequestEvent
pub fn from(xevent: &'a XEvent) -> XMapRequestEvent
impl<'a> From<&'a XCirculateEvent> for XEvent
pub fn from(other: &'a XCirculateEvent) -> XEvent
impl From<XEvent> for XClientMessageEvent
pub fn from(xevent: XEvent) -> XClientMessageEvent
impl From<XSelectionClearEvent> for XEvent
pub fn from(other: XSelectionClearEvent) -> XEvent
impl From<XRRResourceChangeNotifyEvent> for XEvent
pub fn from(other: XRRResourceChangeNotifyEvent) -> XEvent
impl From<XKeymapEvent> for XEvent
pub fn from(other: XKeymapEvent) -> XEvent
impl From<XResizeRequestEvent> for XEvent
pub fn from(other: XResizeRequestEvent) -> XEvent
impl From<XEvent> for XRRResourceChangeNotifyEvent
pub fn from(xevent: XEvent) -> XRRResourceChangeNotifyEvent
impl<'a> From<&'a XSelectionEvent> for XEvent
pub fn from(other: &'a XSelectionEvent) -> XEvent
impl<'a> From<&'a XRRProviderPropertyNotifyEvent> for XEvent
pub fn from(other: &'a XRRProviderPropertyNotifyEvent) -> XEvent
impl From<XEvent> for XF86VidModeNotifyEvent
pub fn from(xevent: XEvent) -> XF86VidModeNotifyEvent
impl From<XEvent> for XButtonEvent
pub fn from(xevent: XEvent) -> XButtonEvent
impl From<XEvent> for XRRProviderChangeNotifyEvent
pub fn from(xevent: XEvent) -> XRRProviderChangeNotifyEvent
impl From<XConfigureRequestEvent> for XEvent
pub fn from(other: XConfigureRequestEvent) -> XEvent
impl<'a> From<&'a XAnyEvent> for XEvent
pub fn from(other: &'a XAnyEvent) -> XEvent
impl<'a> From<&'a XColormapEvent> for XEvent
pub fn from(other: &'a XColormapEvent) -> XEvent
impl From<XEvent> for XReparentEvent
pub fn from(xevent: XEvent) -> XReparentEvent
impl From<[i64; 5]> for ClientMessageData
impl From<XEvent> for XKeyEvent
pub fn from(xevent: XEvent) -> XKeyEvent
impl From<XCreateWindowEvent> for XEvent
pub fn from(other: XCreateWindowEvent) -> XEvent
impl From<XUnmapEvent> for XEvent
pub fn from(other: XUnmapEvent) -> XEvent
impl From<XGraphicsExposeEvent> for XEvent
pub fn from(other: XGraphicsExposeEvent) -> XEvent
impl From<XEvent> for XGraphicsExposeEvent
pub fn from(xevent: XEvent) -> XGraphicsExposeEvent
impl From<XEvent> for XSelectionClearEvent
pub fn from(xevent: XEvent) -> XSelectionClearEvent
impl<'a> From<&'a XEvent> for XCirculateEvent
pub fn from(xevent: &'a XEvent) -> XCirculateEvent
impl From<XPropertyEvent> for XEvent
pub fn from(other: XPropertyEvent) -> XEvent
impl From<XEvent> for XCirculateEvent
pub fn from(xevent: XEvent) -> XCirculateEvent
impl<'a> From<&'a XEvent> for XVisibilityEvent
pub fn from(xevent: &'a XEvent) -> XVisibilityEvent
impl From<XRRCrtcChangeNotifyEvent> for XEvent
pub fn from(other: XRRCrtcChangeNotifyEvent) -> XEvent
impl From<XEvent> for XVisibilityEvent
pub fn from(xevent: XEvent) -> XVisibilityEvent
impl<'a> From<&'a XEvent> for XRRResourceChangeNotifyEvent
pub fn from(xevent: &'a XEvent) -> XRRResourceChangeNotifyEvent
impl From<XEvent> for XErrorEvent
pub fn from(xevent: XEvent) -> XErrorEvent
impl<'a> From<&'a XEvent> for XFocusChangeEvent
pub fn from(xevent: &'a XEvent) -> XFocusChangeEvent
impl From<[u64; 5]> for ClientMessageData
impl<'a> From<&'a XDestroyWindowEvent> for XEvent
pub fn from(other: &'a XDestroyWindowEvent) -> XEvent
impl<'a> From<&'a XCirculateRequestEvent> for XEvent
pub fn from(other: &'a XCirculateRequestEvent) -> XEvent
impl<'a> From<&'a XEvent> for XNoExposeEvent
pub fn from(xevent: &'a XEvent) -> XNoExposeEvent
impl From<XEvent> for XAnyEvent
pub fn from(xevent: XEvent) -> XAnyEvent
impl<'a> From<&'a XEvent> for XCreateWindowEvent
pub fn from(xevent: &'a XEvent) -> XCreateWindowEvent
impl From<XRRScreenChangeNotifyEvent> for XEvent
pub fn from(other: XRRScreenChangeNotifyEvent) -> XEvent
impl From<XEvent> for XRRScreenChangeNotifyEvent
pub fn from(xevent: XEvent) -> XRRScreenChangeNotifyEvent
impl<'a> From<&'a XEvent> for XMotionEvent
pub fn from(xevent: &'a XEvent) -> XMotionEvent
impl<'a> From<&'a XRRResourceChangeNotifyEvent> for XEvent
pub fn from(other: &'a XRRResourceChangeNotifyEvent) -> XEvent
impl<'a> From<&'a XGraphicsExposeEvent> for XEvent
pub fn from(other: &'a XGraphicsExposeEvent) -> XEvent
impl<'a> From<&'a XEvent> for XResizeRequestEvent
pub fn from(xevent: &'a XEvent) -> XResizeRequestEvent
impl<'a> From<&'a XEvent> for XGraphicsExposeEvent
pub fn from(xevent: &'a XEvent) -> XGraphicsExposeEvent
impl From<XButtonEvent> for XEvent
pub fn from(other: XButtonEvent) -> XEvent
impl<'a> From<&'a XClientMessageEvent> for XEvent
pub fn from(other: &'a XClientMessageEvent) -> XEvent
impl<'a> From<&'a XEvent> for XRRNotifyEvent
pub fn from(xevent: &'a XEvent) -> XRRNotifyEvent
impl<'a> From<&'a XVisibilityEvent> for XEvent
pub fn from(other: &'a XVisibilityEvent) -> XEvent
impl From<XEvent> for XRROutputPropertyNotifyEvent
pub fn from(xevent: XEvent) -> XRROutputPropertyNotifyEvent
impl<'a> From<&'a XEvent> for XSelectionRequestEvent
pub fn from(xevent: &'a XEvent) -> XSelectionRequestEvent
impl From<XErrorEvent> for XEvent
pub fn from(other: XErrorEvent) -> XEvent
impl From<XEvent> for XExposeEvent
pub fn from(xevent: XEvent) -> XExposeEvent
impl From<XExposeEvent> for XEvent
pub fn from(other: XExposeEvent) -> XEvent
impl From<XMapRequestEvent> for XEvent
pub fn from(other: XMapRequestEvent) -> XEvent
impl<'a> From<&'a XRRProviderChangeNotifyEvent> for XEvent
pub fn from(other: &'a XRRProviderChangeNotifyEvent) -> XEvent
impl<'a> From<&'a XCrossingEvent> for XEvent
pub fn from(other: &'a XCrossingEvent) -> XEvent
impl From<XSelectionEvent> for XEvent
pub fn from(other: XSelectionEvent) -> XEvent
impl From<XReparentEvent> for XEvent
pub fn from(other: XReparentEvent) -> XEvent
impl From<[u8; 20]> for ClientMessageData
impl<'a> From<&'a XSelectionRequestEvent> for XEvent
pub fn from(other: &'a XSelectionRequestEvent) -> XEvent
impl From<XEvent> for XResizeRequestEvent
pub fn from(xevent: XEvent) -> XResizeRequestEvent
impl From<[u16; 10]> for ClientMessageData
impl From<XEvent> for XCrossingEvent
pub fn from(xevent: XEvent) -> XCrossingEvent
impl<'a> From<&'a XEvent> for XErrorEvent
pub fn from(xevent: &'a XEvent) -> XErrorEvent
impl From<XEvent> for XMapEvent
pub fn from(xevent: XEvent) -> XMapEvent
impl<'a> From<&'a XRROutputChangeNotifyEvent> for XEvent
pub fn from(other: &'a XRROutputChangeNotifyEvent) -> XEvent
impl<'a> From<&'a XEvent> for XMappingEvent
pub fn from(xevent: &'a XEvent) -> XMappingEvent
impl<'a> From<&'a XMapRequestEvent> for XEvent
pub fn from(other: &'a XMapRequestEvent) -> XEvent
impl<'a> From<&'a XEvent> for XRRProviderPropertyNotifyEvent
pub fn from(xevent: &'a XEvent) -> XRRProviderPropertyNotifyEvent
impl<'a> From<&'a XRRCrtcChangeNotifyEvent> for XEvent
pub fn from(other: &'a XRRCrtcChangeNotifyEvent) -> XEvent
impl<'a> From<&'a XEvent> for XButtonEvent
pub fn from(xevent: &'a XEvent) -> XButtonEvent
impl From<XAnyEvent> for XEvent
pub fn from(other: XAnyEvent) -> XEvent
impl<'a> From<&'a XEvent> for XKeymapEvent
pub fn from(xevent: &'a XEvent) -> XKeymapEvent
impl From<XEvent> for XRROutputChangeNotifyEvent
pub fn from(xevent: XEvent) -> XRROutputChangeNotifyEvent
impl<'a> From<&'a XEvent> for XRRScreenChangeNotifyEvent
pub fn from(xevent: &'a XEvent) -> XRRScreenChangeNotifyEvent
impl From<XEvent> for XScreenSaverNotifyEvent
pub fn from(xevent: XEvent) -> XScreenSaverNotifyEvent
impl From<XRROutputPropertyNotifyEvent> for XEvent
pub fn from(other: XRROutputPropertyNotifyEvent) -> XEvent
impl<'a> From<&'a XRRNotifyEvent> for XEvent
pub fn from(other: &'a XRRNotifyEvent) -> XEvent
impl From<XEvent> for XPropertyEvent
pub fn from(xevent: XEvent) -> XPropertyEvent
impl<'a> From<&'a XEvent> for XRRCrtcChangeNotifyEvent
pub fn from(xevent: &'a XEvent) -> XRRCrtcChangeNotifyEvent
impl<'a> From<&'a XEvent> for XCirculateRequestEvent
pub fn from(xevent: &'a XEvent) -> XCirculateRequestEvent
impl<'a> From<&'a XKeyEvent> for XEvent
pub fn from(other: &'a XKeyEvent) -> XEvent
impl From<XEvent> for XKeymapEvent
pub fn from(xevent: XEvent) -> XKeymapEvent
impl<'a> From<&'a XEvent> for XReparentEvent
pub fn from(xevent: &'a XEvent) -> XReparentEvent
impl From<XCrossingEvent> for XEvent
pub fn from(other: XCrossingEvent) -> XEvent
impl From<XEvent> for XUnmapEvent
pub fn from(xevent: XEvent) -> XUnmapEvent
impl From<XEvent> for XSelectionEvent
pub fn from(xevent: XEvent) -> XSelectionEvent
impl From<XEvent> for XRRCrtcChangeNotifyEvent
pub fn from(xevent: XEvent) -> XRRCrtcChangeNotifyEvent
impl<'a> From<&'a XPropertyEvent> for XEvent
pub fn from(other: &'a XPropertyEvent) -> XEvent
impl From<XColormapEvent> for XEvent
pub fn from(other: XColormapEvent) -> XEvent
impl<'a> From<&'a XEvent> for XF86VidModeNotifyEvent
pub fn from(xevent: &'a XEvent) -> XF86VidModeNotifyEvent
impl From<XEvent> for XRRNotifyEvent
pub fn from(xevent: XEvent) -> XRRNotifyEvent
impl<'a> From<&'a XKeymapEvent> for XEvent
pub fn from(other: &'a XKeymapEvent) -> XEvent
impl<'a> From<&'a XConfigureRequestEvent> for XEvent
pub fn from(other: &'a XConfigureRequestEvent) -> XEvent
impl From<XNoExposeEvent> for XEvent
pub fn from(other: XNoExposeEvent) -> XEvent
impl From<XEvent> for XMapRequestEvent
pub fn from(xevent: XEvent) -> XMapRequestEvent
impl From<XVisibilityEvent> for XEvent
pub fn from(other: XVisibilityEvent) -> XEvent
impl From<XEvent> for XMotionEvent
pub fn from(xevent: XEvent) -> XMotionEvent
impl From<XMappingEvent> for XEvent
pub fn from(other: XMappingEvent) -> XEvent
impl<'a> From<&'a XEvent> for XKeyEvent
pub fn from(xevent: &'a XEvent) -> XKeyEvent
impl From<XGravityEvent> for XEvent
pub fn from(other: XGravityEvent) -> XEvent
impl<'a> From<&'a XEvent> for XClientMessageEvent
pub fn from(xevent: &'a XEvent) -> XClientMessageEvent
impl From<XRROutputChangeNotifyEvent> for XEvent
pub fn from(other: XRROutputChangeNotifyEvent) -> XEvent
impl<'a> From<&'a XErrorEvent> for XEvent
pub fn from(other: &'a XErrorEvent) -> XEvent
impl<'a> From<&'a XEvent> for XPropertyEvent
pub fn from(xevent: &'a XEvent) -> XPropertyEvent
impl<'a> From<&'a XGravityEvent> for XEvent
pub fn from(other: &'a XGravityEvent) -> XEvent
impl<'a> From<&'a XEvent> for XRROutputPropertyNotifyEvent
pub fn from(xevent: &'a XEvent) -> XRROutputPropertyNotifyEvent
impl From<XEvent> for XCreateWindowEvent
pub fn from(xevent: XEvent) -> XCreateWindowEvent
impl From<XClientMessageEvent> for XEvent
pub fn from(other: XClientMessageEvent) -> XEvent
impl From<XEvent> for XNoExposeEvent
pub fn from(xevent: XEvent) -> XNoExposeEvent
impl<'a> From<&'a XResizeRequestEvent> for XEvent
pub fn from(other: &'a XResizeRequestEvent) -> XEvent
impl<'a> From<&'a XSelectionClearEvent> for XEvent
pub fn from(other: &'a XSelectionClearEvent) -> XEvent
impl From<XRRNotifyEvent> for XEvent
pub fn from(other: XRRNotifyEvent) -> XEvent
impl From<XEvent> for XFocusChangeEvent
pub fn from(xevent: XEvent) -> XFocusChangeEvent
impl<'a> From<&'a XNoExposeEvent> for XEvent
pub fn from(other: &'a XNoExposeEvent) -> XEvent
impl<'a> From<&'a XCreateWindowEvent> for XEvent
pub fn from(other: &'a XCreateWindowEvent) -> XEvent
impl From<XConfigureEvent> for XEvent
pub fn from(other: XConfigureEvent) -> XEvent
impl From<XEvent> for XSelectionRequestEvent
pub fn from(xevent: XEvent) -> XSelectionRequestEvent
impl From<XGenericEventCookie> for XEvent
pub fn from(other: XGenericEventCookie) -> XEvent
impl From<XEvent> for XConfigureRequestEvent
pub fn from(xevent: XEvent) -> XConfigureRequestEvent
impl<'a> From<&'a XEvent> for XSelectionClearEvent
pub fn from(xevent: &'a XEvent) -> XSelectionClearEvent
impl<'a> From<&'a XReparentEvent> for XEvent
pub fn from(other: &'a XReparentEvent) -> XEvent
impl<'a> From<&'a XConfigureEvent> for XEvent
pub fn from(other: &'a XConfigureEvent) -> XEvent
impl From<XScreenSaverNotifyEvent> for XEvent
pub fn from(other: XScreenSaverNotifyEvent) -> XEvent
impl<'a> From<&'a XEvent> for XColormapEvent
pub fn from(xevent: &'a XEvent) -> XColormapEvent
impl From<XEvent> for XRRProviderPropertyNotifyEvent
pub fn from(xevent: XEvent) -> XRRProviderPropertyNotifyEvent
impl<'a> From<&'a XEvent> for XScreenSaverNotifyEvent
pub fn from(xevent: &'a XEvent) -> XScreenSaverNotifyEvent
impl<'a> From<&'a XRRScreenChangeNotifyEvent> for XEvent
pub fn from(other: &'a XRRScreenChangeNotifyEvent) -> XEvent
impl<'a> From<&'a XExposeEvent> for XEvent
pub fn from(other: &'a XExposeEvent) -> XEvent
impl From<XEvent> for XGenericEventCookie
pub fn from(xevent: XEvent) -> XGenericEventCookie
impl<'a> From<&'a XEvent> for XRRProviderChangeNotifyEvent
pub fn from(xevent: &'a XEvent) -> XRRProviderChangeNotifyEvent
impl<'a> From<&'a XEvent> for XConfigureRequestEvent
pub fn from(xevent: &'a XEvent) -> XConfigureRequestEvent
impl<'a> From<&'a XEvent> for XCrossingEvent
pub fn from(xevent: &'a XEvent) -> XCrossingEvent
impl<'a> From<&'a XGenericEventCookie> for XEvent
pub fn from(other: &'a XGenericEventCookie) -> XEvent
impl<'a> From<&'a XEvent> for XAnyEvent
pub fn from(xevent: &'a XEvent) -> XAnyEvent
impl From<XCirculateRequestEvent> for XEvent
pub fn from(other: XCirculateRequestEvent) -> XEvent
impl From<XEvent> for XDestroyWindowEvent
pub fn from(xevent: XEvent) -> XDestroyWindowEvent
impl<'a> From<&'a XMapEvent> for XEvent
pub fn from(other: &'a XMapEvent) -> XEvent
impl From<XFocusChangeEvent> for XEvent
pub fn from(other: XFocusChangeEvent) -> XEvent
impl From<XDestroyWindowEvent> for XEvent
pub fn from(other: XDestroyWindowEvent) -> XEvent
impl<'a> From<&'a XFocusChangeEvent> for XEvent
pub fn from(other: &'a XFocusChangeEvent) -> XEvent
impl<'a> From<&'a XEvent> for XSelectionEvent
pub fn from(xevent: &'a XEvent) -> XSelectionEvent
impl<'a> From<&'a XMotionEvent> for XEvent
pub fn from(other: &'a XMotionEvent) -> XEvent
impl From<[i16; 10]> for ClientMessageData
impl<'a> From<&'a XEvent> for XExposeEvent
pub fn from(xevent: &'a XEvent) -> XExposeEvent
impl From<XEvent> for XGravityEvent
pub fn from(xevent: XEvent) -> XGravityEvent
impl<'a> From<&'a XEvent> for XUnmapEvent
pub fn from(xevent: &'a XEvent) -> XUnmapEvent
impl<'a> From<&'a XRROutputPropertyNotifyEvent> for XEvent
pub fn from(other: &'a XRROutputPropertyNotifyEvent) -> XEvent
impl From<XRRProviderPropertyNotifyEvent> for XEvent
pub fn from(other: XRRProviderPropertyNotifyEvent) -> XEvent
impl<'a> From<&'a XEvent> for XGenericEventCookie
pub fn from(xevent: &'a XEvent) -> XGenericEventCookie
impl From<XEvent> for XCirculateRequestEvent
pub fn from(xevent: XEvent) -> XCirculateRequestEvent
impl From<XMotionEvent> for XEvent
pub fn from(other: XMotionEvent) -> XEvent
impl From<XCirculateEvent> for XEvent
pub fn from(other: XCirculateEvent) -> XEvent
impl From<XRRProviderChangeNotifyEvent> for XEvent
pub fn from(other: XRRProviderChangeNotifyEvent) -> XEvent
impl From<XSelectionRequestEvent> for XEvent
pub fn from(other: XSelectionRequestEvent) -> XEvent
impl<'a> From<&'a OwnedWgpuVertexBufferDescriptor> for VertexBufferDescriptor<'a>
pub fn from(
val: &'a OwnedWgpuVertexBufferDescriptor
) -> VertexBufferDescriptor<'a>
val: &'a OwnedWgpuVertexBufferDescriptor
) -> VertexBufferDescriptor<'a>
impl<A> From<A> for ArrayVec<A> where
A: Array,
[src]
A: Array,
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);
impl<T> From<Option<T>> for OptionFuture<T>
[src]
pub fn from(option: Option<T>) -> OptionFuture<T>
[src]
impl<T> From<T> for Mutex<T>
[src]
impl<'a, F> From<Box<F>> for FutureObj<'a, ()> where
F: 'a + Send + Future<Output = ()>,
[src]
F: 'a + Send + Future<Output = ()>,
impl<'a> From<Pin<Box<dyn Future<Output = ()> + 'a>>> for LocalFutureObj<'a, ()>
[src]
impl<'a, F> From<Pin<Box<F>>> for FutureObj<'a, ()> where
F: 'a + Send + Future<Output = ()>,
[src]
F: 'a + Send + Future<Output = ()>,
impl<'a, F> From<Box<F>> for LocalFutureObj<'a, ()> where
F: 'a + Future<Output = ()>,
[src]
F: 'a + Future<Output = ()>,
pub fn from(boxed: Box<F>) -> LocalFutureObj<'a, ()>
[src]
impl<'a, F> From<Pin<Box<F>>> for LocalFutureObj<'a, ()> where
F: 'a + Future<Output = ()>,
[src]
F: 'a + Future<Output = ()>,
impl<'a> From<Pin<Box<dyn Future<Output = ()> + 'a + Send>>> for FutureObj<'a, ()>
[src]
impl<'a, T> From<FutureObj<'a, T>> for LocalFutureObj<'a, T>
[src]
pub fn from(f: FutureObj<'a, T>) -> LocalFutureObj<'a, T>
[src]
impl<'a> From<Box<dyn Future<Output = ()> + 'a>> for LocalFutureObj<'a, ()>
[src]
impl<'a> From<Box<dyn Future<Output = ()> + 'a + Send>> for FutureObj<'a, ()>
[src]
impl From<DeviceError> for CreateComputePipelineError
pub fn from(source: DeviceError) -> CreateComputePipelineError
impl From<DeviceError> for CreateSamplerError
pub fn from(source: DeviceError) -> CreateSamplerError
impl From<CreatePipelineLayoutError> for ImplicitLayoutError
pub fn from(source: CreatePipelineLayoutError) -> ImplicitLayoutError
impl From<DeviceError> for SwapChainError
pub fn from(source: DeviceError) -> SwapChainError
impl From<MissingBufferUsageError> for ComputePassError
pub fn from(source: MissingBufferUsageError) -> ComputePassError
impl From<DeviceError> for CreateRenderPipelineError
pub fn from(source: DeviceError) -> CreateRenderPipelineError
impl From<RenderCommandError> for RenderBundleError
pub fn from(source: RenderCommandError) -> RenderBundleError
impl From<DeviceError> for RenderBundleError
pub fn from(source: DeviceError) -> RenderBundleError
impl From<MissingBufferUsageError> for CreateBindGroupError
pub fn from(source: MissingBufferUsageError) -> CreateBindGroupError
impl From<DeviceType> for DeviceType
pub fn from(device_type: DeviceType) -> DeviceType
impl From<DeviceError> for CreateTextureError
pub fn from(source: DeviceError) -> CreateTextureError
impl From<MissingTextureUsageError> for RenderCommandError
pub fn from(source: MissingTextureUsageError) -> RenderCommandError
impl From<MissingBufferUsageError> for RenderCommandError
pub fn from(source: MissingBufferUsageError) -> RenderCommandError
impl From<CreateBindGroupLayoutError> for ImplicitLayoutError
pub fn from(source: CreateBindGroupLayoutError) -> ImplicitLayoutError
impl From<CommandEncoderError> for CopyError
pub fn from(source: CommandEncoderError) -> CopyError
impl From<DeviceError> for CreatePipelineLayoutError
pub fn from(source: DeviceError) -> CreatePipelineLayoutError
impl From<DeviceError> for CreateSwapChainError
pub fn from(source: DeviceError) -> CreateSwapChainError
impl From<MissingTextureUsageError> for RenderPassError
pub fn from(error: MissingTextureUsageError) -> RenderPassError
impl From<ValidationError> for CreateShaderModuleError
pub fn from(source: ValidationError) -> CreateShaderModuleError
impl From<CommandEncoderError> for RenderPassError
pub fn from(source: CommandEncoderError) -> RenderPassError
impl From<MissingBufferUsageError> for BufferAccessError
pub fn from(source: MissingBufferUsageError) -> BufferAccessError
impl From<PushConstantUploadError> for ComputePassError
pub fn from(source: PushConstantUploadError) -> ComputePassError
impl From<BindError> for ComputePassError
pub fn from(source: BindError) -> ComputePassError
impl From<ImplicitLayoutError> for CreateComputePipelineError
pub fn from(source: ImplicitLayoutError) -> CreateComputePipelineError
impl From<DeviceError> for BufferAccessError
pub fn from(source: DeviceError) -> BufferAccessError
impl From<MissingBufferUsageError> for RenderPassError
pub fn from(error: MissingBufferUsageError) -> RenderPassError
impl From<RenderCommandError> for RenderPassError
pub fn from(source: RenderCommandError) -> RenderPassError
impl From<BindError> for RenderPassError
pub fn from(source: BindError) -> RenderPassError
impl From<TextureDimensionError> for CreateTextureError
pub fn from(source: TextureDimensionError) -> CreateTextureError
impl From<DeviceError> for CreateBindGroupLayoutError
pub fn from(source: DeviceError) -> CreateBindGroupLayoutError
impl From<CommandEncoderError> for ComputePassError
pub fn from(source: CommandEncoderError) -> ComputePassError
impl From<MapError> for BufferAccessError
pub fn from(error: MapError) -> BufferAccessError
impl From<DeviceError> for CommandAllocatorError
pub fn from(source: DeviceError) -> CommandAllocatorError
impl From<DrawError> for RenderPassError
pub fn from(source: DrawError) -> RenderPassError
impl From<OomOrDeviceLost> for DeviceError
pub fn from(err: OomOrDeviceLost) -> DeviceError
impl From<DeviceError> for CreateShaderModuleError
pub fn from(source: DeviceError) -> CreateShaderModuleError
impl From<BufferAccessError> for CreateBufferError
pub fn from(source: BufferAccessError) -> CreateBufferError
impl From<TransferError> for CopyError
pub fn from(source: TransferError) -> CopyError
impl From<MissingTextureUsageError> for CreateBindGroupError
pub fn from(source: MissingTextureUsageError) -> CreateBindGroupError
impl From<DeviceError> for CreateBindGroupError
pub fn from(source: DeviceError) -> CreateBindGroupError
impl From<DrawError> for RenderBundleError
pub fn from(source: DrawError) -> RenderBundleError
impl From<DeviceError> for CreateBufferError
pub fn from(source: DeviceError) -> CreateBufferError
impl From<DispatchError> for ComputePassError
pub fn from(source: DispatchError) -> ComputePassError
impl From<PushConstantUploadError> for RenderCommandError
pub fn from(source: PushConstantUploadError) -> RenderCommandError
impl From<ImplicitLayoutError> for CreateRenderPipelineError
pub fn from(source: ImplicitLayoutError) -> CreateRenderPipelineError
impl From<OutOfMemory> for BindError
pub fn from(error: OutOfMemory) -> BindError
impl From<OutOfMemory> for CreationError
pub fn from(error: OutOfMemory) -> CreationError
impl From<OutOfMemory> for ShaderError
pub fn from(error: OutOfMemory) -> ShaderError
impl From<OutOfMemory> for CreationError
pub fn from(error: OutOfMemory) -> CreationError
impl From<OutOfMemory> for OomOrDeviceLost
pub fn from(error: OutOfMemory) -> OomOrDeviceLost
impl From<SubresourceLayers> for SubresourceRange
pub fn from(sub: SubresourceLayers) -> SubresourceRange
impl From<WindowInUse> for CreationError
pub fn from(error: WindowInUse) -> CreationError
impl From<OutOfMemory> for CreationError
pub fn from(error: OutOfMemory) -> CreationError
impl From<OutOfMemory> for ViewCreationError
pub fn from(error: OutOfMemory) -> ViewCreationError
impl From<[f32; 4]> for PackedColor
impl From<OutOfMemory> for AllocationError
pub fn from(error: OutOfMemory) -> AllocationError
impl From<DeviceLost> for CreationError
pub fn from(error: DeviceLost) -> CreationError
impl<'_, T> From<T> for Specialization<'_> where
T: SpecConstList,
T: SpecConstList,
pub fn from(list: T) -> Specialization<'_>
impl From<OutOfMemory> for CreationError
pub fn from(error: OutOfMemory) -> CreationError
impl From<Extent> for Extent2D
pub fn from(ex: Extent) -> Extent2D
impl From<OutOfMemory> for MapError
pub fn from(error: OutOfMemory) -> MapError
impl From<SurfaceLost> for CreationError
pub fn from(error: SurfaceLost) -> CreationError
impl From<usize> for MemoryTypeId
impl From<OutOfMemory> for ViewCreationError
pub fn from(error: OutOfMemory) -> ViewCreationError
impl From<DeviceLost> for OomOrDeviceLost
pub fn from(error: DeviceLost) -> OomOrDeviceLost
impl From<OutOfMemory> for CreationError
pub fn from(err: OutOfMemory) -> CreationError
impl From<Library> for Library
pub fn from(lib: Library) -> Library
impl From<Library> for Library
pub fn from(lib: Library) -> Library
impl From<Backend> for BackendBit
pub fn from(backend: Backend) -> BackendBit
impl From<TextureFormat> for ColorStateDescriptor
pub fn from(format: TextureFormat) -> ColorStateDescriptor
impl From<TextureFormat> for TextureComponentType
pub fn from(format: TextureFormat) -> TextureComponentType
impl From<OutOfMemory> for HeapsError
pub fn from(error: OutOfMemory) -> HeapsError
impl From<AllocationError> for HeapsError
pub fn from(error: AllocationError) -> HeapsError
impl From<Error> for Error
impl<'a> From<UnexpectedConstantTypeError> for Error<'a>
pub fn from(source: UnexpectedConstantTypeError) -> Error<'a>
impl From<Level> for LevelFilter
[src]
pub fn from(level: Level) -> LevelFilter
[src]
impl From<Option<Level>> for LevelFilter
[src]
pub fn from(level: Option<Level>) -> LevelFilter
[src]
impl<S> From<S> for Dispatch where
S: Subscriber + Send + Sync + 'static,
[src]
S: Subscriber + Send + Sync + 'static,
impl<T> From<SendError<T>> for Error
impl From<DistanceModelError> for Error
pub fn from(f: DistanceModelError) -> Error
impl From<Duration> for Ticks
impl From<input_event> for EvCode
pub fn from(f: input_event) -> EvCode
impl<'a> From<&'a sigevent> for SigEvent
pub fn from(sigevent: &sigevent) -> SigEvent
impl From<termios> for Termios
pub fn from(termios: termios) -> Termios
impl<'_> From<&'_ passwd> for User
pub fn from(pw: &passwd) -> User
impl From<timespec> for TimeSpec
pub fn from(ts: timespec) -> TimeSpec
impl<'a> From<Vec<AioCb<'a>>> for LioCb<'a>
impl From<Errno> for Error
pub fn from(errno: Errno) -> Error
impl From<Termios> for termios
pub fn from(termios: Termios) -> termios
impl From<ucred> for UnixCredentials
pub fn from(cred: ucred) -> UnixCredentials
impl From<timeval> for TimeVal
pub fn from(tv: timeval) -> TimeVal
impl From<Gid> for u32
impl<'_> From<&'_ group> for Group
pub fn from(gr: &group) -> Group
impl From<Errno> for Error
impl From<Pid> for i32
impl From<FromUtf8Error> for Error
pub fn from(FromUtf8Error) -> Error
impl From<TimerSpec> for Expiration
pub fn from(timerspec: TimerSpec) -> Expiration
impl From<Uid> for u32
Loading content...Implementors
impl From<&'static str> for NodeLabel
impl From<&'static str> for SlotLabel
impl From<AssetIoError> for AssetServerError
pub fn from(source: AssetIoError) -> AssetServerError
impl From<RenderGraphError> for StagerError
pub fn from(source: RenderGraphError) -> StagerError
impl From<ErrorKind> for DimensionError
[src]
fn from(err: ErrorKind) -> DimensionError
[src]
impl From<ErrorKind> for bevy_tilemap::map::MapError
[src]
impl From<[f32; 2]> for Vec2
[src]
impl From<[f32; 3]> for Vec3A
[src]
impl From<[f32; 3]> for Vec3
[src]
impl From<[f32; 4]> for ColorSource
pub fn from(f32s: [f32; 4]) -> ColorSource
impl From<[f32; 4]> for Quat
[src]
impl From<[f32; 4]> for Vec4
[src]
impl From<[f32; 4]> for Color
impl From<(f32, f32, f32, f32)> for Quat
[src]
impl From<(f32, f32, f32, f32)> for Vec4
[src]
impl From<(f32, f32, f32)> for Vec3A
[src]
impl From<(f32, f32, f32)> for Vec3
[src]
impl From<(f32, f32)> for Vec2
[src]
impl From<usize> for SlotLabel
impl From<AssetPathId> for HandleId
pub fn from(value: AssetPathId) -> HandleId
impl From<AssetPathId> for SourcePathId
pub fn from(id: AssetPathId) -> SourcePathId
impl From<MissingComponent> for ComponentError
pub fn from(x: MissingComponent) -> ComponentError
impl From<NoSuchEntity> for ComponentError
pub fn from(NoSuchEntity) -> ComponentError
impl From<Quat> for Vec4
[src]
impl From<Vec3A> for Vec3
[src]
impl From<Vec4> for ColorSource
pub fn from(vec4: Vec4) -> ColorSource
impl From<Vec4> for Quat
[src]
impl From<Vec4> for Color
impl From<Color> for ColorSource
pub fn from(color: Color) -> ColorSource
impl From<Color> for Vec4
impl From<Color> for ColorMaterial
pub fn from(color: Color) -> ColorMaterial
impl From<Cube> for Mesh
impl From<Icosphere> for Mesh
impl From<Plane> for Mesh
impl From<Quad> for Mesh
impl From<NodeId> for NodeLabel
impl From<BufferId> for RenderResourceId
pub fn from(value: BufferId) -> RenderResourceId
impl From<SamplerId> for RenderResourceId
pub fn from(value: SamplerId) -> RenderResourceId
impl From<TextureId> for RenderResourceId
pub fn from(value: TextureId) -> RenderResourceId
impl From<GlobalTransform> for Transform
pub fn from(transform: GlobalTransform) -> Transform
impl From<Box<str>> for Box<[u8]>
[src]
pub fn from(s: Box<str>) -> Box<[u8]>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a Box<str>
into a Box<[u8]>
This conversion does not allocate on the heap and happens in place.
Examples
// create a Box<str> which will be used to create a Box<[u8]> let boxed: Box<str> = Box::from("hello"); let boxed_str: Box<[u8]> = Box::from(boxed); // create a &[u8] which will be used to create a Box<[u8]> let slice: &[u8] = &[104, 101, 108, 108, 111]; let boxed_slice = Box::from(slice); assert_eq!(boxed_slice, boxed_str);
impl From<Handle<Texture>> for ColorSource
pub fn from(texture: Handle<Texture>) -> ColorSource
impl From<Handle<Texture>> for ColorMaterial
pub fn from(texture: Handle<Texture>) -> ColorMaterial
impl From<Transform> for GlobalTransform
pub fn from(transform: Transform) -> GlobalTransform
impl From<Vec3> for Vec3A
[src]
impl From<Vec<[f32; 2]>> for VertexAttributeValues
impl From<Vec<[f32; 3]>> for VertexAttributeValues
impl From<Vec<[f32; 4]>> for VertexAttributeValues
impl From<Vec<f32>> for VertexAttributeValues
pub fn from(vec: Vec<f32>) -> VertexAttributeValues
impl From<String> for NodeLabel
impl From<String> for SlotLabel
impl From<String> for Arc<str>
[src]
impl From<String> for Box<str>
[src]
pub fn from(s: String) -> Box<str>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts the given String
to a boxed str
slice that is owned.
Examples
Basic usage:
let s1: String = String::from("hello world"); let s2: Box<str> = Box::from(s1); let s3: String = String::from(s2); assert_eq!("hello world", s3)
impl From<String> for Box<dyn Error + 'static + Sync + Send>
[src]
pub fn from(err: String) -> Box<dyn Error + 'static + Sync + Send>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a String
into a box of dyn Error
+ Send
+ Sync
.
Examples
use std::error::Error; use std::mem; let a_string_error = "a string error".to_string(); let a_boxed_error = Box::<dyn Error + Send + Sync>::from(a_string_error); assert!( mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
impl From<String> for Box<dyn Error + 'static>
[src]
pub fn from(str_err: String) -> Box<dyn Error + 'static>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl From<String> for Vec<u8>
[src]
pub fn from(string: String) -> Vec<u8>ⓘ
[src]
Converts the given String
to a vector Vec
that holds values of type u8
.
Examples
Basic usage:
let s1 = String::from("hello world"); let v1 = Vec::from(s1); for b in v1 { println!("{}", b); }
impl From<__m128> for Quat
[src]
impl From<__m128> for Vec3A
[src]
impl From<__m128> for Vec4
[src]
impl From<CString> for Arc<CStr>
[src]
impl From<CString> for Box<CStr>
[src]
pub fn from(s: CString) -> Box<CStr>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl From<CString> for Vec<u8>
[src]
impl From<OsString> for Arc<OsStr>
[src]
impl From<OsString> for Box<OsStr>
[src]
pub fn from(s: OsString) -> Box<OsStr>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl From<Error> for AssetIoError
pub fn from(source: Error) -> AssetIoError
impl From<PathBuf> for Arc<Path>
[src]
pub fn from(s: PathBuf) -> Arc<Path>
[src]
Converts a PathBuf
into an Arc
by moving the PathBuf
data into a new Arc
buffer.
impl From<PathBuf> for Box<Path>
[src]
pub fn from(p: PathBuf) -> Box<Path>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a PathBuf
into a Box<Path>
This conversion currently should not allocate memory, but this behavior is not guaranteed on all platforms or in all future versions.
impl From<Error> for Box<dyn Error + 'static + Send>
[src]
pub fn from(error: Error) -> Box<dyn Error + 'static + Send>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl From<Error> for Box<dyn Error + 'static + Sync + Send>
[src]
pub fn from(error: Error) -> Box<dyn Error + 'static + Sync + Send>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl From<Error> for Box<dyn Error + 'static>
[src]
pub fn from(error: Error) -> Box<dyn Error + 'static>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl From<Box2D<i32, UnknownUnit>> for bevy_tilemap::Rect
impl From<StreamResult> for Result<MZStatus, MZError>
impl From<StreamResult> for Result<MZStatus, MZError>
impl<'_> From<&'_ Indices> for IndexFormat
pub fn from(indices: &Indices) -> IndexFormat
impl<'_> From<&'_ VertexAttributeValues> for VertexFormat
pub fn from(values: &VertexAttributeValues) -> VertexFormat
impl<'_> From<&'_ NodeLabel> for NodeLabel
impl<'_> From<&'_ SlotLabel> for SlotLabel
impl<'_> From<&'_ str> for HandleId
impl<'_> From<&'_ str> for Arc<str>
[src]
impl<'_> From<&'_ str> for Box<str>
[src]
pub fn from(s: &str) -> Box<str>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a &str
into a Box<str>
This conversion allocates on the heap
and performs a copy of s
.
Examples
let boxed: Box<str> = Box::from("hello"); println!("{}", boxed);
impl<'_> From<&'_ str> for Box<dyn Error + 'static>
[src]
pub fn from(err: &str) -> Box<dyn Error + 'static>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'_> From<&'_ str> for Vec<u8>
[src]
impl<'_> From<&'_ HandleUntyped> for HandleId
pub fn from(value: &HandleUntyped) -> HandleId
impl<'_> From<&'_ ResourceSlotInfo> for ResourceSlot
pub fn from(slot: &ResourceSlotInfo) -> ResourceSlot
impl<'_> From<&'_ Texture> for TextureDescriptor
pub fn from(texture: &Texture) -> TextureDescriptor
impl<'_> From<&'_ CStr> for Arc<CStr>
[src]
impl<'_> From<&'_ CStr> for Box<CStr>
[src]
pub fn from(s: &CStr) -> Box<CStr>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'_> From<&'_ OsStr> for Arc<OsStr>
[src]
impl<'_> From<&'_ OsStr> for Box<OsStr>
[src]
pub fn from(s: &OsStr) -> Box<OsStr>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'_> From<&'_ Path> for Arc<Path>
[src]
pub fn from(s: &Path) -> Arc<Path>
[src]
Converts a Path
into an Arc
by copying the Path
data into a new Arc
buffer.
impl<'_> From<&'_ Path> for Box<Path>
[src]
pub fn from(path: &Path) -> Box<Path>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'_> From<&'_ StreamResult> for Result<MZStatus, MZError>
impl<'_> From<&'_ StreamResult> for Result<MZStatus, MZError>
impl<'_> From<Cow<'_, str>> for Box<str>
[src]
pub fn from(cow: Cow<'_, str>) -> Box<str>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'_> From<Cow<'_, CStr>> for Box<CStr>
[src]
pub fn from(cow: Cow<'_, CStr>) -> Box<CStr>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'_> From<Cow<'_, OsStr>> for Box<OsStr>
[src]
pub fn from(cow: Cow<'_, OsStr>) -> Box<OsStr>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'_> From<Cow<'_, Path>> for Box<Path>
[src]
pub fn from(cow: Cow<'_, Path>) -> Box<Path>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'_> From<&'_ [ResourceSlotInfo]> for ResourceSlots
pub fn from(slots: &[ResourceSlotInfo]) -> ResourceSlots
impl<'_, T> From<&'_ Handle<T>> for HandleId
impl<'_, T> From<Cow<'_, [T]>> for Box<[T]> where
T: Copy,
[src]
T: Copy,
pub fn from(cow: Cow<'_, [T]>) -> Box<[T]>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'_, T> From<&'_ [T]> for Arc<[T]> where
T: Clone,
[src]
T: Clone,
impl<'_, T> From<&'_ [T]> for Box<[T]> where
T: Copy,
[src]
T: Copy,
pub fn from(slice: &[T]) -> Box<[T]>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a &[T]
into a Box<[T]>
This conversion allocates on the heap
and performs a copy of slice
.
Examples
// create a &[u8] which will be used to create a Box<[u8]> let slice: &[u8] = &[104, 101, 108, 108, 111]; let boxed_slice: Box<[u8]> = Box::from(slice); println!("{:?}", boxed_slice);
impl<'_, T> From<&'_ [T]> for Vec<T> where
T: Clone,
[src]
T: Clone,
impl<'_, T> From<&'_ mut [T]> for Vec<T> where
T: Clone,
[src]
T: Clone,
impl<'a> From<&'a str> for AssetPath<'a>
impl<'a> From<&'a Path> for AssetPath<'a>
impl<'a> From<&'a Path> for SourcePathId
pub fn from(value: &'a Path) -> SourcePathId
impl<'a> From<&'a Chmap> for Vec<ChmapPosition>
impl<'a> From<Option<&'a str>> for LabelId
impl<'a> From<Cow<'a, str>> for Box<dyn Error + 'static>
[src]
pub fn from(err: Cow<'a, str>) -> Box<dyn Error + 'static>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'a> From<AssetPath<'a>> for HandleId
impl<'a> From<AssetPath<'a>> for SourcePathId
pub fn from(path: AssetPath<'_>) -> SourcePathId
impl<'a> From<PathBuf> for AssetPath<'a>
impl<'a, '_> From<&'_ str> for Box<dyn Error + 'a + Sync + Send>
[src]
pub fn from(err: &str) -> Box<dyn Error + 'a + Sync + Send>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<'a, 'b> From<&'a AssetPath<'b>> for AssetPathId
pub fn from(asset_path: &'a AssetPath<'b>) -> AssetPathId
impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + 'a + Sync + Send>
[src]
pub fn from(err: Cow<'b, str>) -> Box<dyn Error + 'a + Sync + Send>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a Cow
into a box of dyn Error
+ Send
+ Sync
.
Examples
use std::error::Error; use std::mem; use std::borrow::Cow; let a_cow_str_error = Cow::from("a str error"); let a_boxed_error = Box::<dyn Error + Send + Sync>::from(a_cow_str_error); assert!( mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
impl<'a, B> From<Cow<'a, B>> for Arc<B> where
B: ToOwned + ?Sized,
Arc<B>: From<&'a B>,
Arc<B>: From<<B as ToOwned>::Owned>,
[src]
B: ToOwned + ?Sized,
Arc<B>: From<&'a B>,
Arc<B>: From<<B as ToOwned>::Owned>,
impl<'a, E> From<E> for Box<dyn Error + 'a + Sync + Send> where
E: 'a + Error + Send + Sync,
[src]
E: 'a + Error + Send + Sync,
pub fn from(err: E) -> Box<dyn Error + 'a + Sync + Send>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a type of Error
+ Send
+ Sync
into a box of
dyn Error
+ Send
+ Sync
.
Examples
use std::error::Error; use std::fmt; use std::mem; #[derive(Debug)] struct AnError; impl fmt::Display for AnError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f , "An error") } } impl Error for AnError {} unsafe impl Send for AnError {} unsafe impl Sync for AnError {} let an_error = AnError; assert!(0 == mem::size_of_val(&an_error)); let a_boxed_error = Box::<dyn Error + Send + Sync>::from(an_error); assert!( mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
impl<'a, E> From<E> for Box<dyn Error + 'a> where
E: 'a + Error,
[src]
E: 'a + Error,
pub fn from(err: E) -> Box<dyn Error + 'a>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a type of Error
into a box of dyn Error
.
Examples
use std::error::Error; use std::fmt; use std::mem; #[derive(Debug)] struct AnError; impl fmt::Display for AnError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f , "An error") } } impl Error for AnError {} let an_error = AnError; assert!(0 == mem::size_of_val(&an_error)); let a_boxed_error = Box::<dyn Error>::from(an_error); assert!(mem::size_of::<Box<dyn Error>>() == mem::size_of_val(&a_boxed_error))
impl<'a, T> From<&'a Option<T>> for Option<&'a T>
[src]
pub fn from(o: &'a Option<T>) -> Option<&'a T>
[src]
Converts from &Option<T>
to Option<&T>
.
Examples
Converts an Option<
String
>
into an Option<
usize
>
, preserving the original.
The map
method takes the self
argument by value, consuming the original,
so this technique uses as_ref
to first take an Option
to a reference
to the value inside the original.
let s: Option<String> = Some(String::from("Hello, Rustaceans!")); let o: Option<usize> = Option::from(&s).map(|ss: &String| ss.len()); println!("Can still print s: {:?}", s); assert_eq!(o, Some(18));
impl<'a, T> From<&'a mut Option<T>> for Option<&'a mut T>
[src]
pub fn from(o: &'a mut Option<T>) -> Option<&'a mut T>
[src]
Converts from &mut Option<T>
to Option<&mut T>
Examples
let mut s = Some(String::from("Hello")); let o: Option<&mut String> = Option::from(&mut s); match o { Some(t) => *t = String::from("Hello, Rustaceans!"), None => (), } assert_eq!(s, Some(String::from("Hello, Rustaceans!")));
impl<'a, T> From<Cow<'a, [T]>> for Vec<T> where
[T]: ToOwned,
<[T] as ToOwned>::Owned == Vec<T>,
[src]
[T]: ToOwned,
<[T] as ToOwned>::Owned == Vec<T>,
impl<'a, T> From<T> for AssetPathId where
T: Into<AssetPath<'a>>,
T: Into<AssetPath<'a>>,
pub fn from(value: T) -> AssetPathId
impl<T> From<!> for T
[src]
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<Box<[T]>> for Vec<T>
[src]
impl<T> From<Box<T>> for Arc<T> where
T: ?Sized,
[src]
T: ?Sized,
impl<T> From<Handle<T>> for HandleId
impl<T> From<Vec<T>> for Arc<[T]>
[src]
impl<T> From<Vec<T>> for Box<[T]>
[src]
pub fn from(v: Vec<T>) -> Box<[T]>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> From<BinaryHeap<T>> for Vec<T>
[src]
pub fn from(heap: BinaryHeap<T>) -> Vec<T>ⓘ
[src]
Converts a BinaryHeap<T>
into a Vec<T>
.
This conversion requires no data movement or allocation, and has constant time complexity.
impl<T> From<VecDeque<T>> for Vec<T>
[src]
pub fn from(other: VecDeque<T>) -> Vec<T>ⓘ
[src]
Turn a VecDeque<T>
into a Vec<T>
.
This never needs to re-allocate, but does need to do O(n) data movement if the circular buffer doesn't happen to be at the beginning of the allocation.
Examples
use std::collections::VecDeque; // This one is *O*(1). let deque: VecDeque<_> = (1..5).collect(); let ptr = deque.as_slices().0.as_ptr(); let vec = Vec::from(deque); assert_eq!(vec, [1, 2, 3, 4]); assert_eq!(vec.as_ptr(), ptr); // This one needs data rearranging. let mut deque: VecDeque<_> = (1..5).collect(); deque.push_front(9); deque.push_front(8); let ptr = deque.as_slices().1.as_ptr(); let vec = Vec::from(deque); assert_eq!(vec, [8, 9, 1, 2, 3, 4]); assert_eq!(vec.as_ptr(), ptr);
impl<T> From<T> for Option<T>
[src]
impl<T> From<T> for bevy_tilemap::bevy_render::once_cell::sync::OnceCell<T>
impl<T> From<T> for bevy_tilemap::bevy_render::once_cell::unsync::OnceCell<T>
impl<T> From<T> for Arc<T>
[src]
impl<T> From<T> for Box<T>
[src]
pub fn from(t: T) -> Box<T>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a generic type T
into a Box<T>
The conversion allocates on the heap and moves t
from the stack into it.
Examples
let x = 5; let boxed = Box::new(5); assert_eq!(Box::from(x), boxed);
impl<T> From<T> for bevy_tilemap::Mutex<T>
[src]
pub fn from(t: T) -> Mutex<T>
[src]
Creates a new mutex in an unlocked state ready for use.
This is equivalent to Mutex::new
.
impl<T> From<T> for T
[src]
impl<T, const N: usize> From<[T; N]> for Box<[T]>
[src]
pub fn from(array: [T; N]) -> Box<[T]>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Converts a [T; N]
into a Box<[T]>
This conversion moves the array to newly heap-allocated memory.
Examples
let boxed: Box<[u8]> = Box::from([4, 2]); println!("{:?}", boxed);